mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: show better authentication failure message
This commit is contained in:
parent
1e6d709e04
commit
0248dd3c23
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user