Merge pull request 'Hibás merge visszavonása' (#5) from balint14/student-legacy:master into master
Reviewed-on: refilc/student-legacy#5
This commit is contained in:
commit
52dd14d10b
@ -84,20 +84,20 @@ Future<void> syncAll(BuildContext context) async {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (user.user!.accessTokenExpire.isBefore(DateTime.now())) {
|
if (user.user!.accessTokenExpire.isBefore(DateTime.now())) {
|
||||||
// String authRes = await Provider.of<KretaClient>(context, listen: false)
|
String authRes = await Provider.of<KretaClient>(context, listen: false)
|
||||||
// .refreshLogin() ??
|
.refreshLogin() ??
|
||||||
// '';
|
'';
|
||||||
// if (authRes != 'success') {
|
if (authRes != 'success') {
|
||||||
// if (kDebugMode) print('ERROR: failed to refresh login');
|
if (kDebugMode) print('ERROR: failed to refresh login');
|
||||||
// lock = false;
|
/ lock = false;
|
||||||
// return Future.value();
|
/ return Future.value();
|
||||||
// } else {
|
/ } else {
|
||||||
// if (kDebugMode) print('INFO: access token refreshed');
|
/ if (kDebugMode) print('INFO: access token refreshed');
|
||||||
// }
|
/ }
|
||||||
//} else {
|
} else {
|
||||||
// if (kDebugMode) print('INFO: access token is not expired');
|
if (kDebugMode) print('INFO: access token is not expired');
|
||||||
//}
|
}
|
||||||
}()),
|
}()),
|
||||||
|
|
||||||
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
||||||
|
@ -91,7 +91,7 @@ class KretaClient {
|
|||||||
headerMap.remove("authorization");
|
headerMap.remove("authorization");
|
||||||
print("DEBUG: 401 error, refreshing login");
|
print("DEBUG: 401 error, refreshing login");
|
||||||
print("DEBUG: 401 error, URL: $url");
|
print("DEBUG: 401 error, URL: $url");
|
||||||
await refreshLogin();
|
//await refreshLogin();
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ class KretaClient {
|
|||||||
|
|
||||||
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
||||||
if (res.statusCode == 401) {
|
if (res.statusCode == 401) {
|
||||||
await refreshLogin();
|
//await refreshLogin();
|
||||||
headerMap.remove("authorization");
|
headerMap.remove("authorization");
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -234,7 +234,7 @@ class KretaClient {
|
|||||||
|
|
||||||
if (res.statusCode == 401) {
|
if (res.statusCode == 401) {
|
||||||
headerMap.remove("authorization");
|
headerMap.remove("authorization");
|
||||||
await refreshLogin();
|
//await refreshLogin();
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user