mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-19 01:29:08 +00:00
Added some logs
This commit is contained in:
@@ -236,6 +236,7 @@ export class AuthController {
|
|||||||
@Get('oauth/google')
|
@Get('oauth/google')
|
||||||
@UseGuards(AuthGuard('google-login'))
|
@UseGuards(AuthGuard('google-login'))
|
||||||
googleOauth() {
|
googleOauth() {
|
||||||
|
this.logger.info('/oauth/google');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +245,10 @@ export class AuthController {
|
|||||||
@Redirect()
|
@Redirect()
|
||||||
async googleOauthCallback(@Req() req) {
|
async googleOauthCallback(@Req() req) {
|
||||||
const { url, email, token, language = 'pt-br' } = await this.callback(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
|
await this.authClient
|
||||||
.oauthSignIn({
|
.oauthSignIn({
|
||||||
@@ -252,9 +256,11 @@ export class AuthController {
|
|||||||
token,
|
token,
|
||||||
})
|
})
|
||||||
.then(({ session }) => {
|
.then(({ session }) => {
|
||||||
|
this.logger.info('/oauth/google - SUCESS');
|
||||||
url.searchParams.set('session', session);
|
url.searchParams.set('session', session);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
this.logger.error('/oauth/google - ERROR');
|
||||||
let error = OauthErrors.INVALID_CREDENTIALS[language].error;
|
let error = OauthErrors.INVALID_CREDENTIALS[language].error;
|
||||||
let error_description =
|
let error_description =
|
||||||
OauthErrors.INVALID_CREDENTIALS[language].error_description;
|
OauthErrors.INVALID_CREDENTIALS[language].error_description;
|
||||||
|
|||||||
Reference in New Issue
Block a user