saving token
This commit is contained in:
parent
bb764f3461
commit
8501c2ca7e
@ -11,7 +11,7 @@
|
||||
{
|
||||
logger.LogInformation("Starting up");
|
||||
|
||||
//await sessionManager.LoadUserFromDisk();
|
||||
await sessionManager.LoadUserFromDisk();
|
||||
|
||||
if (sessionManager.IsLoggedIn)
|
||||
{
|
||||
|
@ -22,7 +22,8 @@ public class SessionManager
|
||||
|
||||
public async Task LoadUserFromDisk()
|
||||
{
|
||||
var lastToken = await SecureStorage.Default.GetAsync(jwt_keychain_key);
|
||||
//var lastToken = await SecureStorage.Default.GetAsync(jwt_keychain_key);
|
||||
var lastToken = Preferences.Default.Get(jwt_keychain_key, string.Empty);
|
||||
|
||||
lastStoredKey = lastToken;
|
||||
|
||||
@ -60,6 +61,8 @@ public class SessionManager
|
||||
lastRefresh = DateTime.Now;
|
||||
|
||||
//await SecureStorage.Default.SetAsync(jwt_keychain_key, lastStoredKey);
|
||||
// I know, but I can't get secure storage to work
|
||||
Preferences.Default.Set(jwt_keychain_key, lastStoredKey);
|
||||
|
||||
break;
|
||||
case SelectorNetClient.TokenResponseStatus.Malformed:
|
||||
@ -80,5 +83,11 @@ public class SessionManager
|
||||
|
||||
return tokenResponse.Status;
|
||||
}
|
||||
|
||||
public void SignOut()
|
||||
{
|
||||
lastStoredKey = null;
|
||||
Preferences.Default.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user