feat(chat): prompt facebook users to open external browser
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
/**
|
||||
* AuthStorage 完整实现(基于 unstorage 抽象)
|
||||
*
|
||||
* 原始 Dart: lib/data/services/storage/auth_storage.dart
|
||||
*
|
||||
* SECURITY: 当前与 Dart 端行为一致,refresh_token 以明文存于 localStorage。
|
||||
* 后续轮次将升级到 HttpOnly Cookie 方案,参见 `clearAuthData` 处的 TODO 标记。
|
||||
*
|
||||
@@ -99,6 +97,9 @@ export class AuthStorage implements IAuthStorage {
|
||||
setFacebookId(id: string): Promise<ResultT<void>> {
|
||||
return SpAsyncUtil.setString(StorageKeys.facebookId, id);
|
||||
}
|
||||
clearFacebookId(): Promise<ResultT<void>> {
|
||||
return SpAsyncUtil.remove(StorageKeys.facebookId);
|
||||
}
|
||||
|
||||
// ---- bulk clear ----
|
||||
|
||||
@@ -107,6 +108,8 @@ export class AuthStorage implements IAuthStorage {
|
||||
if (!r1.success) return r1;
|
||||
const r2 = await this.clearGuestToken();
|
||||
if (!r2.success) return r2;
|
||||
return this.clearRefreshToken();
|
||||
const r3 = await this.clearRefreshToken();
|
||||
if (!r3.success) return r3;
|
||||
return this.clearFacebookId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface IAuthStorage {
|
||||
|
||||
getFacebookId(): Promise<Result<string | null>>;
|
||||
setFacebookId(id: string): Promise<Result<void>>;
|
||||
clearFacebookId(): Promise<Result<void>>;
|
||||
|
||||
clearAuthData(): Promise<Result<void>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user