mirror of
https://github.com/strapi/strapi.git
synced 2025-08-12 18:53:23 +00:00
fix error handling
This commit is contained in:
parent
de6537791e
commit
9404cb352e
@ -9,7 +9,8 @@ const sso = require('./passport/sso');
|
||||
const { isSsoLocked } = require('../utils/sso-lock');
|
||||
|
||||
const localStrategyMiddleware = async ([error, user, message], done) => {
|
||||
if (await isSsoLocked(user)) {
|
||||
// if we got a user, we need to check that it's not sso locked
|
||||
if (user && !error && (await isSsoLocked(user))) {
|
||||
throw new UnauthorizedError('Login not allowed, please contact your administrator', {
|
||||
code: 'LOGIN_NOT_ALLOWED',
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user