👔 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:
@ -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!",
|
||||
|
||||
Reference in New Issue
Block a user