Content-Length: 248972 | pFad | http://github.com/namecheap/ilc/pull/344/files

97 fix: using a few openIds for user by nightnei · Pull Request #344 · namecheap/ilc · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: using a few openIds for user #344

Merged
merged 2 commits into from
Dec 22, 2021
Merged
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
15 changes: 11 additions & 4 deletions registry/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,17 @@ export default (app: Express, settingsService: SettingsService, config: any): Re
identifiers = [identifiers];
}

let user: any;
let user: User | null = null;
for (let id of identifiers) {
user = await getEntityWithCreds('openid', id, null);
if (user) {
const entity = await getEntityWithCreds('openid', id, null);
if (!entity) {
continue;
}

user = entity;

// we may have case when user exists for a few identifiers, so we try find the most permissive role
if (entity.role === AuthRoles.admin) {
break;
}
}
Expand All @@ -157,7 +164,7 @@ export default (app: Express, settingsService: SettingsService, config: any): Re
return done(null, false, { message: `Can\'t find presented identifiers "${identifiers.toString()}" in auth entities list` });
}
if (uidClaimName && claims[uidClaimName]) {
user.identifier = claims[uidClaimName];
user.identifier = claims[uidClaimName] as string;
}

return done(null, user);
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/namecheap/ilc/pull/344/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy