Skip to content

Commit

Permalink
Fix 401 during validation causing error
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Jul 6, 2024
1 parent a037741 commit aef47b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,12 @@ class User {
try {
Response resp = await data.dio.get(
"${data.baseUrl}/validate-token",
options: Options(headers: {"Authorization": "Bearer $token"}),
options: Options(
headers: {"Authorization": "Bearer $token"},
validateStatus: (status) {
return status == 200 || status == 401;
},
),
);

if (resp.data['success'] != true) {
Expand Down

0 comments on commit aef47b0

Please sign in to comment.