TF-886 Implement GetAuthenticationInfo stored in repository and datasource
This commit is contained in:
@@ -11,4 +11,8 @@ class AuthenticationInfoCacheManager {
|
||||
AuthenticationInfoCache.keyCacheValue,
|
||||
authenticationInfoCache);
|
||||
}
|
||||
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
|
||||
return _authenticationInfoCacheClient.getItem(AuthenticationInfoCache.keyCacheValue);
|
||||
}
|
||||
}
|
||||
@@ -32,36 +32,16 @@ class CredentialRepositoryImpl extends CredentialRepository {
|
||||
await sharedPreferences.remove(LoginConstant.keyBaseUrl);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Password> getPassword() async {
|
||||
return Password(sharedPreferences.getString(LoginConstant.keyPassword) ?? '');
|
||||
}
|
||||
|
||||
@override
|
||||
Future removePassword() async {
|
||||
await sharedPreferences.remove(LoginConstant.keyPassword);
|
||||
}
|
||||
|
||||
@override
|
||||
Future savePassword(Password password) async {
|
||||
await sharedPreferences.setString(LoginConstant.keyPassword, password.value);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserName> getUserName() async {
|
||||
return UserName(sharedPreferences.getString(LoginConstant.keyUserName) ?? '');
|
||||
}
|
||||
|
||||
@override
|
||||
Future removeUserName() async {
|
||||
await sharedPreferences.remove(LoginConstant.keyUserName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future saveUserName(UserName userName) async {
|
||||
await sharedPreferences.setString(LoginConstant.keyUserName, userName.userName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfile> getUserProfile() async {
|
||||
final json = sharedPreferences.getString(LoginConstant.keyUserProfile) ?? '';
|
||||
@@ -85,4 +65,9 @@ class CredentialRepositoryImpl extends CredentialRepository {
|
||||
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache) {
|
||||
return _authenticationInfoCacheManager.storeAuthenticationInfo(authenticationInfoCache);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
|
||||
return _authenticationInfoCacheManager.getAuthenticationInfoStored();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user