mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Clarified some oauth things in the docs (#9203)
This commit is contained in:
@@ -98,9 +98,9 @@ export class OAuth2AuthDriver extends LocalAuthDriver {
|
||||
|
||||
const { emailKey, identifierKey, allowPublicRegistration } = this.config;
|
||||
|
||||
const email = userInfo[emailKey ?? 'email'] as string | undefined;
|
||||
const email = userInfo[emailKey ?? 'email'] as string | null | undefined;
|
||||
// Fallback to email if explicit identifier not found
|
||||
const identifier = (userInfo[identifierKey] as string | undefined) ?? email;
|
||||
const identifier = (userInfo[identifierKey] as string | null | undefined) ?? email;
|
||||
|
||||
if (!identifier) {
|
||||
logger.warn(`Failed to find user identifier for provider "${this.config.provider}"`);
|
||||
|
||||
@@ -99,9 +99,9 @@ export class OpenIDAuthDriver extends LocalAuthDriver {
|
||||
|
||||
const { identifierKey, allowPublicRegistration, requireVerifiedEmail } = this.config;
|
||||
|
||||
const email = userInfo.email as string;
|
||||
const email = userInfo.email as string | null | undefined;
|
||||
// Fallback to email if explicit identifier not found
|
||||
const identifier = (userInfo[identifierKey ?? 'sub'] as string | undefined) ?? email;
|
||||
const identifier = (userInfo[identifierKey ?? 'sub'] as string | null | undefined) ?? email;
|
||||
|
||||
if (!identifier) {
|
||||
logger.warn(`Failed to find user identifier for provider "${this.config.provider}"`);
|
||||
|
||||
Reference in New Issue
Block a user