diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 30c93ec..e7682ac 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -236,6 +236,7 @@ export class AuthController { @Get('oauth/google') @UseGuards(AuthGuard('google-login')) googleOauth() { + this.logger.info('/oauth/google'); return true; } @@ -244,7 +245,10 @@ export class AuthController { @Redirect() async googleOauthCallback(@Req() req) { const { url, email, token, language = 'pt-br' } = await this.callback(req); - if (url.searchParams.get('error')) return { url: url.href }; + if (url.searchParams.get('error')) { + this.logger.error('/oauth/google - ERROR'); + return { url: url.href }; + } await this.authClient .oauthSignIn({ @@ -252,9 +256,11 @@ export class AuthController { token, }) .then(({ session }) => { + this.logger.info('/oauth/google - SUCESS'); url.searchParams.set('session', session); }) .catch((err) => { + this.logger.error('/oauth/google - ERROR'); let error = OauthErrors.INVALID_CREDENTIALS[language].error; let error_description = OauthErrors.INVALID_CREDENTIALS[language].error_description;