feat: handle disabled auth strategies
This commit is contained in:
1 parent
715364de1d
commit
8490fc1267
7 files changed
+113
-71
No files matched your search
@@ -277,6 +277,10 @@ module.exports = class User extends Model {
|
||||
static async login (opts, context) {
|
||||
if (_.has(WIKI.auth.strategies, opts.strategy)) {
|
||||
const selStrategy = _.get(WIKI.auth.strategies, opts.strategy)
|
||||
if (!selStrategy.isEnabled) {
|
||||
throw new WIKI.Error.AuthProviderInvalid()
|
||||
}
|
||||
|
||||
const strInfo = _.find(WIKI.data.authentication, ['key', selStrategy.strategyKey])
|
||||
|
||||
// Inject form user/pass
|
||||
|
||||
Reference in new issue
Block a user