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:
parent
d45cbeb0fb
commit
0cc9408857
8 changed files with 35 additions and 19 deletions
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue