mirror of
https://github.com/plankanban/planka.git
synced 2025-07-21 22:29:42 +02:00
fix: Lazy initialize OIDC client (#947)
This commit is contained in:
parent
2109fea800
commit
480c280ab3
4 changed files with 58 additions and 23 deletions
|
@ -3,6 +3,9 @@ const { v4: uuid } = require('uuid');
|
|||
const { getRemoteAddress } = require('../../../utils/remoteAddress');
|
||||
|
||||
const Errors = {
|
||||
INVALID_OIDC_CONFIGURATION: {
|
||||
invalidOIDCConfiguration: 'Invalid OIDC configuration',
|
||||
},
|
||||
INVALID_CODE_OR_NONCE: {
|
||||
invalidCodeOrNonce: 'Invalid code or nonce',
|
||||
},
|
||||
|
@ -37,6 +40,9 @@ module.exports = {
|
|||
},
|
||||
|
||||
exits: {
|
||||
invalidOIDCConfiguration: {
|
||||
responseType: 'serverError',
|
||||
},
|
||||
invalidCodeOrNonce: {
|
||||
responseType: 'unauthorized',
|
||||
},
|
||||
|
@ -63,6 +69,7 @@ module.exports = {
|
|||
sails.log.warn(`Invalid code or nonce! (IP: ${remoteAddress})`);
|
||||
return Errors.INVALID_CODE_OR_NONCE;
|
||||
})
|
||||
.intercept('invalidOIDCConfiguration', () => Errors.INVALID_OIDC_CONFIGURATION)
|
||||
.intercept('invalidUserinfoConfiguration', () => Errors.INVALID_USERINFO_CONFIGURATION)
|
||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE)
|
||||
.intercept('usernameAlreadyInUse', () => Errors.USERNAME_ALREADY_IN_USE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue