Skip to content

Commit

Permalink
Update api_service_provider.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
salahamassi committed Mar 30, 2024
1 parent 74161bb commit ebf5974
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/providers/api_service_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class ApiServiceProvider extends ServiceProvider {
baseUrl: config('API_BASE_URL'),
);
Api.extraHeaders = () {
final token = Auth.token();
return {
if (token != null) 'Authorization': 'Bearer $token',
if (Auth.check()) 'Authorization': 'Bearer ${Auth.token()}',
};
};
baseOptions.headers = Api.headers();
Expand Down

0 comments on commit ebf5974

Please sign in to comment.