Ejemplo n.º 1
0
        public async Task <bool> Login(string userName, string password)
        {
            var resp = await _restManager.LoginAsync(userName, password);

            IsLogged = !string.IsNullOrWhiteSpace(resp?.token);
            if (!IsLogged)
            {
                return(false);
            }
            SharedPreferencesService.LastLogin = userName;
            SharedPreferencesService.AuthToken = resp.token;
            SharedPreferencesService.UserId    = resp.user_id;
            return(true);
        }