add new oauth provider

add google idconnect as new auth provider
This commit is contained in:
Rafi Arrafif
2025-08-06 15:31:24 +07:00
parent 419b5b0ae4
commit 0d71710b14
7 changed files with 121 additions and 1 deletions

View 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);
}
};