✨ add new oauth provider
add google idconnect as new auth provider
This commit is contained in:
18
src/modules/auth/controllers/googleRequest.controller.ts
Normal file
18
src/modules/auth/controllers/googleRequest.controller.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Context } from "elysia";
|
||||
import { mainErrorHandler } from "../../../helpers/error/handler";
|
||||
import { googleRequestService } from "../services/googleRequest.service";
|
||||
import { returnReadResponse } from "../../../helpers/callback/httpResponse";
|
||||
|
||||
export const googleRequestController = async (ctx: Context) => {
|
||||
try {
|
||||
const loginUrl = await googleRequestService();
|
||||
return returnReadResponse(
|
||||
ctx.set,
|
||||
200,
|
||||
"Google login url created!",
|
||||
loginUrl
|
||||
);
|
||||
} catch (error) {
|
||||
return mainErrorHandler(ctx.set, error);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user