1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

ref: Refactoring, fix linting

This commit is contained in:
Maksim Eltyshev 2024-07-16 12:33:38 +02:00
parent d45cbeb0fb
commit 0cc9408857
8 changed files with 35 additions and 19 deletions

View file

@ -11,8 +11,8 @@ module.exports = {
},
exits: {
invalidUserInfoSignature: {},
invalidCodeOrNonce: {},
invalidUserinfoSignature: {},
missingValues: {},
emailAlreadyInUse: {},
usernameAlreadyInUse: {},
@ -35,10 +35,14 @@ module.exports = {
);
userInfo = await client.userinfo(tokenSet);
} catch (e) {
if (e instanceof SyntaxError && e.message.includes('Unexpected token e in JSON at position 0')) {
sails.log.warn('Error while exchanging OIDC code: userInfo response is signed.');
throw 'invalidUserInfoSignature';
if (
e instanceof SyntaxError &&
e.message.includes('Unexpected token e in JSON at position 0')
) {
sails.log.warn('Error while exchanging OIDC code: userinfo response is signed');
throw 'invalidUserinfoSignature';
}
sails.log.warn(`Error while exchanging OIDC code: ${e}`);
throw 'invalidCodeOrNonce';
}