fix some other bugs of iam
This commit is contained in:
@@ -608,6 +608,25 @@ export class CustomerAuthService {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* نشست IAM همین ورود را میبندد تا اپ دیگر هم با رفرش خارج شود.
|
||||
* شکست اینجا خروج محلی را متوقف نمیکند؛ پرش مرورگر به IAM هنوز کوکی را پاک میکند.
|
||||
*/
|
||||
async endSharedSessions(mobile: string): Promise<{ ended: number }> {
|
||||
if (!this.iam.enabled) return { ended: 0 };
|
||||
const ids = await this.sessions.activeIamSessionIds(mobile);
|
||||
let ended = 0;
|
||||
for (const id of ids) {
|
||||
try {
|
||||
await this.iam.endDelegatedSession(id);
|
||||
ended += 1;
|
||||
} catch (error) {
|
||||
this.logger.warn(`central sign-out skipped for ${id}: ${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
return { ended };
|
||||
}
|
||||
|
||||
private withBootstrap<T extends { token: string; customer: { id: string; mobile: string } }>(
|
||||
body: T,
|
||||
identity: IamIdentity | null,
|
||||
|
||||
Reference in New Issue
Block a user