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

feat: Add ability to enforce SSO

Closes #543, closes #545
This commit is contained in:
Maksim Eltyshev 2024-02-01 00:31:15 +01:00
parent 0dc24ffafd
commit 5e8027f5d6
10 changed files with 80 additions and 46 deletions

View file

@ -1,6 +1,9 @@
const zxcvbn = require('zxcvbn');
const Errors = {
NOT_ENOUGH_RIGHTS: {
notEnoughRights: 'Not enough rights',
},
EMAIL_ALREADY_IN_USE: {
emailAlreadyInUse: 'Email already in use',
},
@ -56,6 +59,9 @@ module.exports = {
},
exits: {
notEnoughRights: {
responseType: 'forbidden',
},
emailAlreadyInUse: {
responseType: 'conflict',
},
@ -65,6 +71,10 @@ module.exports = {
},
async fn(inputs) {
if (sails.config.custom.oidcEnforced) {
throw Errors.NOT_ENOUGH_RIGHTS;
}
const values = _.pick(inputs, [
'email',
'password',