saving token
This commit is contained in:
parent
bb764f3461
commit
8501c2ca7e
@ -11,7 +11,7 @@
|
|||||||
{
|
{
|
||||||
logger.LogInformation("Starting up");
|
logger.LogInformation("Starting up");
|
||||||
|
|
||||||
//await sessionManager.LoadUserFromDisk();
|
await sessionManager.LoadUserFromDisk();
|
||||||
|
|
||||||
if (sessionManager.IsLoggedIn)
|
if (sessionManager.IsLoggedIn)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,8 @@ public class SessionManager
|
|||||||
|
|
||||||
public async Task LoadUserFromDisk()
|
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;
|
lastStoredKey = lastToken;
|
||||||
|
|
||||||
@ -60,6 +61,8 @@ public class SessionManager
|
|||||||
lastRefresh = DateTime.Now;
|
lastRefresh = DateTime.Now;
|
||||||
|
|
||||||
//await SecureStorage.Default.SetAsync(jwt_keychain_key, lastStoredKey);
|
//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;
|
break;
|
||||||
case SelectorNetClient.TokenResponseStatus.Malformed:
|
case SelectorNetClient.TokenResponseStatus.Malformed:
|
||||||
@ -80,5 +83,11 @@ public class SessionManager
|
|||||||
|
|
||||||
return tokenResponse.Status;
|
return tokenResponse.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SignOut()
|
||||||
|
{
|
||||||
|
lastStoredKey = null;
|
||||||
|
Preferences.Default.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user