✨ add new oauth provider
add google idconnect as new auth provider
This commit is contained in:
20
src/modules/auth/controllers/googleCallback.controller.ts
Normal file
20
src/modules/auth/controllers/googleCallback.controller.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { Context } from "elysia";
|
||||
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
|
||||
import { mainErrorHandler } from "../../../helpers/error/handler";
|
||||
import { googleCallbackService } from "../services/googleCallback.service";
|
||||
|
||||
export const googleCallbackController = async (
|
||||
ctx: Context & { query: { code: string; state: string } }
|
||||
) => {
|
||||
try {
|
||||
const userData = await googleCallbackService(ctx.query);
|
||||
return returnWriteResponse(
|
||||
ctx.set,
|
||||
200,
|
||||
"Authenticated successfully!",
|
||||
userData
|
||||
);
|
||||
} catch (error) {
|
||||
return mainErrorHandler(ctx.set, error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user