chore: show better authentication failure message

This commit is contained in:
Kingkor Roy Tirtho 2025-02-11 22:35:51 +06:00
parent 1e6d709e04
commit 0248dd3c23

View File

@ -118,17 +118,10 @@ class AuthenticationNotifier extends AsyncNotifier<AuthenticationTableData?> {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
},
validateStatus: (status) => true,
),
);
final body = res.data;
if ((res.statusCode ?? 500) >= 400) {
throw Exception(
"Failed to get access token: ${body['error'] ?? res.statusMessage}",
);
}
return AuthenticationTableCompanion.insert(
id: const Value(0),
cookie: DecryptedText("${res.headers["set-cookie"]?.join(";")}; $spDc"),