Пример #1
0
        public async Task <bool> Login(LoginDTO loginDTO)
        {
            ApiResponseDTO <string> response = await _client.PostAsync <string>("Auth/Login", loginDTO);

            if (response.Code != 200)
            {
                return(false);
            }
            else
            {
                _credentialsKeeper.SetCredentials(loginDTO.UsernameOrEmail, response.Value);
                _authStateProvider.Refresh();
                return(true);
            }
        }
Пример #2
0
 public void Logout()
 {
     _credentialsKeeper.SetCredentials(null, null);
     _authStateProvider.Refresh();
 }