Profile Page

This commit is contained in:
Andre Beging
2022-05-21 18:22:18 +02:00
parent e71ef30641
commit 5961c06004
12 changed files with 178 additions and 19 deletions

View File

@@ -157,5 +157,25 @@ namespace FoodsharingSiegen.Server.Auth
}
#endregion
#region Public Method RefreshState
/// <summary>
/// Refreshes the state (a. beging, 21.05.2022)
/// </summary>
public async Task RefreshState()
{
if (_user == null) return;
_user = await Context.Users?.FirstOrDefaultAsync(x => x.Id == _user.Id)!;
if (_user != null)
{
var serializedToken = AuthHelper.CreateToken(_user);
await _localStorageService.SetItem(StorageKeys.TokenKey, serializedToken);
}
}
#endregion
}
}