Skip to content

Commit

Permalink
aa debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Sep 10, 2024
1 parent ac8d93c commit 6134001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/core/src/plugins/oauth2/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function handleOauth(
await this[provider].getAccessTokenFromAuthorizationCodeFlow(request);
const oauthUser = await providers[provider].getUserDetails(token);
const user = await createIfNotExists(oauthUser, userId);

request.log.warn(user);
const isUserInApp = inApp.split('?')[0] === 'true';
const tokenParam = `?token=${user.generateJWT()}`;
const isWeb = `${Config.WEB_URL}/login${tokenParam}`;
Expand Down
9 changes: 7 additions & 2 deletions apps/core/src/plugins/oauth2/oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ async function oauth2(app: FastifyInstance, opts: NextOauthOptions) {
}

// Unknwon (probably db) error
request.log.warn({ error }, 'Unknow oauth error');
return reply.internalServerError('Could not login');
request.log.warn({
msg: 'deu merda severa',
error,
});
return reply.internalServerError(
'Algo de errado aconteceu no seu login, tente novamente',
);
}
},
);
Expand Down

0 comments on commit 6134001

Please sign in to comment.