👔 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 { Context } from "elysia";
|
||||||
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
|
import { returnReadResponse } from "../../../helpers/callback/httpResponse";
|
||||||
import { mainErrorHandler } from "../../../helpers/error/handler";
|
import { mainErrorHandler } from "../../../helpers/error/handler";
|
||||||
import { googleCallbackService } from "../services/http/googleCallback.service";
|
import { googleCallbackService } from "../services/http/googleCallback.service";
|
||||||
import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUserHeaderInformation";
|
import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUserHeaderInformation";
|
||||||
@ -7,12 +7,11 @@ import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUs
|
|||||||
export const googleCallbackController = async (
|
export const googleCallbackController = async (
|
||||||
ctx: Context & { query: { code: string; state: string } }
|
ctx: Context & { query: { code: string; state: string } }
|
||||||
) => {
|
) => {
|
||||||
return ctx;
|
|
||||||
try {
|
try {
|
||||||
const userHeaderInfo = getUserHeaderInformation(ctx);
|
const userHeaderInfo = getUserHeaderInformation(ctx);
|
||||||
|
|
||||||
const userData = await googleCallbackService(ctx.query, userHeaderInfo);
|
const userData = await googleCallbackService(ctx.query, userHeaderInfo);
|
||||||
return returnWriteResponse(
|
return returnReadResponse(
|
||||||
ctx.set,
|
ctx.set,
|
||||||
200,
|
200,
|
||||||
"Authenticated successfully!",
|
"Authenticated successfully!",
|
||||||
|
|||||||
Reference in New Issue
Block a user