mirror of
https://github.com/plankanban/planka.git
synced 2025-07-21 06:09:43 +02:00
fix: OIDC finalization and refactoring
This commit is contained in:
parent
aae69cb5e4
commit
8e0c60f5be
70 changed files with 753 additions and 427 deletions
|
@ -1,4 +1,7 @@
|
|||
const Errors = {
|
||||
NOT_ENOUGH_RIGHTS: {
|
||||
notEnoughRights: 'Not enough rights',
|
||||
},
|
||||
USER_NOT_FOUND: {
|
||||
userNotFound: 'User not found',
|
||||
},
|
||||
|
@ -14,6 +17,9 @@ module.exports = {
|
|||
},
|
||||
|
||||
exits: {
|
||||
notEnoughRights: {
|
||||
responseType: 'forbidden',
|
||||
},
|
||||
userNotFound: {
|
||||
responseType: 'notFound',
|
||||
},
|
||||
|
@ -27,7 +33,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
user = await sails.helpers.users.deleteOne.with({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue