Exemple #1
0
        public DeleteAuthKeyResponse DeleteAuthKey(DeleteAuthKeyRequest data)
        {
            data.UserNr = GetUserAuthenticationData().UserNr;
            DeleteAuthKeyResponse response = _client.DeleteAuthKey(data);

            return(response);
        }
        public DeleteAuthKeyResponse DeleteAuthKey(DeleteAuthKeyRequest request)
        {
            DeleteAuthKeyResponse response = new DeleteAuthKeyResponse
            {
                Success = true,
                Error   = ""
            };

            User_Keys DbKey = db.User_Keys.FirstOrDefault(k => k.UserNr == request.UserNr && k.KeyNr == request.KeyNr);

            if (DbKey == null)
            {
                response.Success = false;
                response.Error   = "No such key found";
                return(response);
            }

            try
            {
                db.User_Keys.Remove(DbKey);
                db.SaveChanges();
            }
            catch (Exception e)
            {
                _logger.ErrorFormat($"error happend error: {e.Message} stacktrace: {e.StackTrace}");
                response.Success = false;
                response.Error   = "An error occured in user creation please check logs for more details";
            }

            return(response);
        }
Exemple #3
0
        public DeleteAuthKeyResponse DeleteAuthKey(DeleteAuthKeyRequest request)
        {
            RestRequest restRequest = new RestRequest("Account/DeleteAuthKey", Method.POST);

            restRequest.AddJsonBody(request);

            DeleteAuthKeyResponse response = _client.Execute <DeleteAuthKeyResponse>(restRequest).Data;

            return(response);
        }
Exemple #4
0
        public DeleteAuthKeyResponse DeleteAuthKey([FromBody] DeleteAuthKeyRequest request)
        {
            DeleteAuthKeyResponse response = _accountFacade.DeleteAuthKey(request);

            return(response);
        }