PCRB webassembly
This commit is contained in:
@ -165,9 +165,7 @@ public class AuthenticationService : IAuthenticationService {
|
||||
await _localStorageService.AddItem("MesaFabApprovalUserId", loginId);
|
||||
}
|
||||
|
||||
public async Task SetCurrentUser(User user) {
|
||||
if (user is null) throw new ArgumentNullException("User cannot be null");
|
||||
|
||||
public async Task SetCurrentUser(User? user) {
|
||||
_cache.Set<User>("MesaFabApprovalCurrentUser", user);
|
||||
await _localStorageService.AddItem<User>("MesaFabApprovalCurrentUser", user);
|
||||
}
|
||||
@ -182,8 +180,10 @@ public class AuthenticationService : IAuthenticationService {
|
||||
public async Task<User> GetCurrentUser() {
|
||||
User? currentUser = null;
|
||||
|
||||
currentUser = _cache.Get<User>("MesaFabApprovalCurrentUser") ??
|
||||
await _localStorageService.GetItem<User>("MesaFabApprovalCurrentUser");
|
||||
currentUser = _cache.Get<User>("MesaFabApprovalCurrentUser");
|
||||
|
||||
if (currentUser is null)
|
||||
currentUser = await _localStorageService.GetItem<User>("MesaFabApprovalCurrentUser");
|
||||
|
||||
return currentUser;
|
||||
}
|
||||
|
Reference in New Issue
Block a user