Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions server/models/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,14 @@ module.exports = class User extends Model {
session: !strInfo.useForm,
scope: strInfo.scopes ? strInfo.scopes : null
}, async (err, user, info) => {
if (err) { return reject(err) }
if (!user) { return reject(new WIKI.Error.AuthLoginFailed()) }
if (err) {
WIKI.logger.warn(`Error trying to authenticate with strategy ${selStrategy.key}: ${JSON.stringify({ err, info })}`)
return reject(err)
}
if (!user) {
WIKI.logger.info(`Authentication failed with strategy ${selStrategy.key}: ${JSON.stringify(info)}`)
return reject(new WIKI.Error.AuthLoginFailed())
}

try {
const resp = await WIKI.models.users.afterLoginChecks(user, context, {
Expand Down