Skip to content

Commit 2c3b69c

Browse files
committed
[#31] Refactor
1 parent 1a6b360 commit 2c3b69c

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

lib/api/interceptor/auth_interceptor.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class AuthInterceptor extends Interceptor {
2020
RequestOptions options,
2121
RequestInterceptorHandler handler,
2222
) async {
23+
print("@@@ get 1");
2324
final token = await _tokenDataSource.getToken();
25+
print("@@@ get here $token");
2426
options.headers.putIfAbsent(
2527
_headerAuthorization, () => "${token.tokenType} ${token.accessToken}");
2628
super.onRequest(options, handler);

lib/di/provider/dio_provider.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:flutter/foundation.dart';
33
import 'package:survey_flutter/api/data_sources/token_data_source.dart';
44
import 'package:survey_flutter/api/interceptor/auth_interceptor.dart';
55
import 'package:survey_flutter/env.dart';
6-
import 'package:survey_flutter/storage/secure_storage.dart';
76

87
const String _headerContentType = 'Content-Type';
98
const String _defaultContentType = 'application/json; charset=utf-8';

lib/repositories/authentication_repository.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class AuthenticationRepositoryImpl extends AuthenticationRepository {
4747
grantType: _grantType,
4848
));
4949
await _tokenDataSource.setToken(response.toApiToken());
50+
print("@@@ settoken ${response.toApiToken()}");
5051
return response.toLoginModel();
5152
} catch (exception) {
5253
throw NetworkExceptions.fromDioException(exception);

0 commit comments

Comments
 (0)