Update: 2026-06-26 04:04:03
This commit is contained in:
@@ -79,18 +79,12 @@ class SessionManager extends GetxController {
|
||||
for (int attempt = 1; attempt <= _maxRetries; attempt++) {
|
||||
Log.print('🔄 Session refresh attempt $attempt/$_maxRetries');
|
||||
|
||||
await CRUD().getJWT();
|
||||
final success = await CRUD().getJWT();
|
||||
|
||||
// التحقق من نجاح التجديد
|
||||
final newRawToken = box.read(BoxName.jwt)?.toString() ?? '';
|
||||
final newToken = newRawToken.isNotEmpty ? r(newRawToken).toString().split(Env.addd)[0] : '';
|
||||
final isValid = CRUD.isJwtValid(newToken);
|
||||
|
||||
if (isValid) {
|
||||
if (success) {
|
||||
status.value = SessionStatus.valid;
|
||||
isRefreshing.value = false;
|
||||
|
||||
// إشعار النجاح
|
||||
if (!silent) {
|
||||
_showSessionRefreshedNotification();
|
||||
}
|
||||
@@ -99,7 +93,6 @@ class SessionManager extends GetxController {
|
||||
return true;
|
||||
}
|
||||
|
||||
// إذا فشلت المحاولة، انتظر قبل إعادة المحاولة
|
||||
if (attempt < _maxRetries) {
|
||||
await Future.delayed(Duration(seconds: attempt));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user