adjusted SSOSettings model and changed all code based on the model

This commit is contained in:
David Leimroth 2022-02-10 14:45:21 +01:00
parent b12a38d12b
commit 3cd09eecba
9 changed files with 251 additions and 103 deletions

View file

@ -217,11 +217,12 @@ class Auth {
async handleOIDCVerification(issuer, profile, cb) {
Logger.debug(`[Auth] handleOIDCVerification ${issuer}`)
let user = this.db.users.find(u => u.id === profile.id)
if (!user && this.db.SSOSettings.createNewUser) {
let user = this.db.users.find(u => u.ssoId === profile.id)
if (!user && this.db.SSOSettings.user.createNewUser) {
// create a user
let account = {}
account.id = profile.id
account.id = profile.username
account.ssoId = profile.id
account.username = profile.username
account.isActive = true
account.type = "guest"