public async Task <ClientAuthUser> Login(LoginVM m) { var user = await httpClient.PostAsJsonAsync <LoginVM, ClientAuthUser>("Account/Login", m, navigateToLoginWhenUnauthorized : false); if (user != null) { await storage.SetItemAsync("user", user); NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } return(user); }
public async Task<ClientAuthUser> Login(LoginVM m) { try { var user = await httpClient.PostAsJsonAsync<LoginVM, ClientAuthUser>("Account/Login", m); if (user != null) { await storage.SetItemAsync("user", user); NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } return user; } catch { return null; } }