Add error logging for user save failure in sso authentication
This commit is contained in:
parent
c41c96e980
commit
65ee7169f8
|
@ -94,7 +94,7 @@ export async function authenticateThirdParty(
|
||||||
try {
|
try {
|
||||||
await saveUserFn(dbUser, { hashPassword: false, requirePassword: false })
|
await saveUserFn(dbUser, { hashPassword: false, requirePassword: false })
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
return authError(done, err)
|
return authError(done, "Error saving user", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// now that we're sure user exists, load them from the db
|
// now that we're sure user exists, load them from the db
|
||||||
|
|
|
@ -27,13 +27,16 @@ export async function oidcCallbackUrl(config?: { callbackURL?: string }) {
|
||||||
return ssoCallbackUrl(tenancy.getGlobalDB(), config, ConfigType.OIDC)
|
return ssoCallbackUrl(tenancy.getGlobalDB(), config, ConfigType.OIDC)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function authInternal(ctx: any, user: any, err = null, info = null) {
|
async function authInternal(ctx: any, user: any, err: any = null, info = null) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error("Authentication error", err)
|
console.error("Authentication error")
|
||||||
|
console.error(err)
|
||||||
|
console.trace(err)
|
||||||
return ctx.throw(403, info ? info : "Unauthorized")
|
return ctx.throw(403, info ? info : "Unauthorized")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
console.error("Authentication error - no user provided")
|
||||||
return ctx.throw(403, info ? info : "Unauthorized")
|
return ctx.throw(403, info ? info : "Unauthorized")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue