0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(core): set default social session (#6784)

This commit is contained in:
wangsijie 2024-11-11 11:04:18 +08:00 committed by GitHub
parent e1044dbae1
commit d804ee0507
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,7 +75,7 @@ export class SocialVerification implements IdentifierVerificationRecord<Verifica
public readonly type = VerificationType.Social; public readonly type = VerificationType.Social;
public readonly connectorId: string; public readonly connectorId: string;
public socialUserInfo?: SocialUserInfo; public socialUserInfo?: SocialUserInfo;
public connectorSession?: ConnectorSession; public connectorSession: ConnectorSession;
private connectorDataCache?: LogtoConnector; private connectorDataCache?: LogtoConnector;
constructor( constructor(
@ -89,7 +89,7 @@ export class SocialVerification implements IdentifierVerificationRecord<Verifica
this.id = id; this.id = id;
this.connectorId = connectorId; this.connectorId = connectorId;
this.socialUserInfo = socialUserInfo; this.socialUserInfo = socialUserInfo;
this.connectorSession = connectorSession; this.connectorSession = connectorSession ?? {};
} }
/** /**
@ -404,7 +404,7 @@ export class SocialVerification implements IdentifierVerificationRecord<Verifica
const socialUserInfo = await this.libraries.socials.getUserInfo( const socialUserInfo = await this.libraries.socials.getUserInfo(
this.connectorId, this.connectorId,
connectorData, connectorData,
async () => this.connectorSession ?? {} async () => this.connectorSession
); );
return socialUserInfo; return socialUserInfo;