feat: 添加账号删除功能
This commit is contained in:
@@ -31,7 +31,13 @@ class ApiClient {
|
||||
final authHeader =
|
||||
error.requestOptions.headers['Authorization'] as String?;
|
||||
final hasAuthHeader = authHeader != null && authHeader.isNotEmpty;
|
||||
if (status == 401 && hasAuthHeader && onUnauthorized != null) {
|
||||
final isLogoutEndpoint =
|
||||
error.requestOptions.method.toUpperCase() == 'DELETE' &&
|
||||
error.requestOptions.path == '/api/v1/auth/sessions';
|
||||
if (status == 401 &&
|
||||
hasAuthHeader &&
|
||||
onUnauthorized != null &&
|
||||
!isLogoutEndpoint) {
|
||||
await onUnauthorized();
|
||||
}
|
||||
handler.next(error);
|
||||
|
||||
Reference in New Issue
Block a user