👔 change response format

Changing from write response to read response because the client must receive data in the form of jwt from the backend.
This commit is contained in:
Rafi Arrafif
2025-08-30 10:21:04 +07:00
parent 305e38bd45
commit 28d2ddad31

View File

@ -1,5 +1,5 @@
import { Context } from "elysia";
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
import { returnReadResponse } from "../../../helpers/callback/httpResponse";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { googleCallbackService } from "../services/http/googleCallback.service";
import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUserHeaderInformation";
@ -7,12 +7,11 @@ import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUs
export const googleCallbackController = async (
ctx: Context & { query: { code: string; state: string } }
) => {
return ctx;
try {
const userHeaderInfo = getUserHeaderInformation(ctx);
const userData = await googleCallbackService(ctx.query, userHeaderInfo);
return returnWriteResponse(
return returnReadResponse(
ctx.set,
200,
"Authenticated successfully!",