mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
OIDC: enable non standard claims in admin check (#230)
* OIDC: enable non standard claims in admin check * give priority to UserInfo
This commit is contained in:
@@ -53,7 +53,8 @@ const OIDCAuthenticationController = {
|
||||
}
|
||||
)(req, res, next)
|
||||
},
|
||||
async doPassportLogin(req, issuer, profile, context, idToken, accessToken, refreshToken, done) {
|
||||
async doPassportLogin(req, issuer, uiProfile, idProfile, context, idToken, accessToken, refreshToken, params, done) {
|
||||
const profile = uiProfile ?? idProfile //id Profile if _skipUserProfile is true
|
||||
let user, info
|
||||
try {
|
||||
if(req.session.intent === 'link') {
|
||||
|
||||
@@ -23,7 +23,8 @@ const OIDCAuthenticationManager = {
|
||||
if (attAdmin === 'email') {
|
||||
isAdmin = (email === valAdmin)
|
||||
} else {
|
||||
isAdmin = (profile[attAdmin] === valAdmin)
|
||||
const adminClaim = profile[attAdmin] || profile._json?.[attAdmin]
|
||||
isAdmin = (adminClaim === valAdmin)
|
||||
}
|
||||
}
|
||||
const oidcUserData = null // Possibly it can be used later
|
||||
|
||||
Reference in New Issue
Block a user