feat(server): storage label claim (#3278)

* feat: storage label claim

* chore: open api
This commit is contained in:
Jason Rasmussen
2023-07-15 15:50:29 -04:00
committed by GitHub
parent ed594c1987
commit f55d63fae8
13 changed files with 64 additions and 6 deletions

View File

@@ -240,11 +240,19 @@ export class AuthService {
}
this.logger.log(`Registering new user: ${profile.email}/${profile.sub}`);
this.logger.verbose(`OAuth Profile: ${JSON.stringify(profile)}`);
let storageLabel: string | null = profile[config.oauth.storageLabelClaim as keyof OAuthProfile] as string;
if (typeof storageLabel !== 'string') {
storageLabel = null;
}
user = await this.userCore.createUser({
firstName: profile.given_name || '',
lastName: profile.family_name || '',
email: profile.email,
oauthId: profile.sub,
storageLabel,
});
}