This commit is contained in:
Hillel Coren 2018-09-27 11:12:01 +03:00
parent 9759eaf52b
commit 12a82d21db
1 changed files with 6 additions and 3 deletions

View File

@ -29,10 +29,13 @@ List<Middleware<AppState>> createStoreAuthMiddleware([
void _saveAuthLocal(dynamic action) async { void _saveAuthLocal(dynamic action) async {
await FlutterKeychain.put(key: kKeychainEmail, value: action.email); await FlutterKeychain.put(key: kKeychainEmail, value: action.email);
if (formatApiUrlReadable(action.url) != kAppUrl) {
await FlutterKeychain.put( await FlutterKeychain.put(
key: kKeychainUrl, value: formatApiUrlMachine(action.url)); key: kKeychainUrl, value: formatApiUrlMachine(action.url));
await FlutterKeychain.put(key: kKeychainSecret, value: action.secret); await FlutterKeychain.put(key: kKeychainSecret, value: action.secret);
} }
}
void _loadAuthLocal(Store<AppState> store, dynamic action) async { void _loadAuthLocal(Store<AppState> store, dynamic action) async {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();