feat: 添加账号删除功能
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import '../../../../core/auth/session_store.dart';
|
||||
import '../../../../core/network/api_problem.dart';
|
||||
import '../apis/auth_api.dart';
|
||||
import '../models/auth_user.dart';
|
||||
|
||||
@@ -70,7 +71,14 @@ class AuthRepositoryImpl implements AuthRepository {
|
||||
try {
|
||||
final refreshToken = await _sessionStore.getRefreshToken();
|
||||
if (refreshToken != null && refreshToken.isNotEmpty) {
|
||||
await _authApi.deleteSession(refreshToken: refreshToken);
|
||||
try {
|
||||
await _authApi.deleteSession(refreshToken: refreshToken);
|
||||
} on ApiProblem catch (problem) {
|
||||
if (problem.status != 401 ||
|
||||
problem.code != 'AUTH_REFRESH_TOKEN_INVALID') {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
await clearLocalSession();
|
||||
|
||||
Reference in New Issue
Block a user