{"action":"created","issue":{"url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/49","repository_url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate","labels_url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/49/comments","events_url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/49/events","html_url":"https://github.com/redound/phalcon-rest-boilerplate/issues/49","id":273073380,"number":49,"title":"User registration","user":{"login":"Echeverrya","id":32680606,"avatar_url":"https://avatars0.githubusercontent.com/u/32680606?v=4","gravatar_id":"","url":"https://api.github.com/users/Echeverrya","html_url":"https://github.com/Echeverrya","followers_url":"https://api.github.com/users/Echeverrya/followers","following_url":"https://api.github.com/users/Echeverrya/following{/other_user}","gists_url":"https://api.github.com/users/Echeverrya/gists{/gist_id}","starred_url":"https://api.github.com/users/Echeverrya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Echeverrya/subscriptions","organizations_url":"https://api.github.com/users/Echeverrya/orgs","repos_url":"https://api.github.com/users/Echeverrya/repos","events_url":"https://api.github.com/users/Echeverrya/events{/privacy}","received_events_url":"https://api.github.com/users/Echeverrya/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-10T22:02:15Z","updated_at":"2017-11-19T13:15:57Z","closed_at":"2017-11-19T13:15:57Z","author_association":"NONE","body":"Hello!\r\nI've added  the following endpoint on userResource file:\r\n` ->endpoint(ApiEndpoint::create()\r\n                ->allow(AclRoles::ALL_ROLES))`\r\n\r\nIn my userController, I've the following function:\r\n`public function transformPostData($data)\r\n    {\r\n        $result = [];\r\n        foreach ($data as $key => $value) {\r\n            //Encrypt password\r\n            if($key == \"password\"){\r\n                $crypted_password = $this->security->hash($value);\r\n                $result[$key] = $crypted_password;\r\n            }else{\r\n                $result[$key] = $value;\r\n            }\r\n        }\r\n\r\n        return $result;\r\n    }`\r\n\r\nIt seems to work as expected, I can register a user, the password is stored on database crypted.\r\n\r\nBut, when I try to authenticate, using Postman, iI get the following error:\r\n\r\n`{\r\n    \"error\": {\r\n        \"code\": 2020,\r\n        \"message\": \"Authentication: Login Failed\",\r\n        \"developer\": {\r\n            \"file\": \"C:\\\\PROJECT\\\\LOCATION\\\\PROJECT_NAME\\\\api\\\\vendor\\\\redound\\\\phalcon-api\\\\src\\\\PhalconApi\\\\Auth\\\\Manager.php\",\r\n            \"line\": 122,\r\n            \"request\": \"POST /PROJECT_NAME/api/users/authenticate\"\r\n        }\r\n    }\r\n}`\r\n\r\nI cant identify what Im missing here, is there another way to crypt the password? Is my way not compatible with Redound API?\r\n\r\nI hugely appreciate any help.\r\n\r\n\r\nThank you in advance!\r\n"},"comment":{"url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/comments/345516184","html_url":"https://github.com/redound/phalcon-rest-boilerplate/issues/49#issuecomment-345516184","issue_url":"https://api.github.com/repos/redound/phalcon-rest-boilerplate/issues/49","id":345516184,"user":{"login":"Echeverrya","id":32680606,"avatar_url":"https://avatars0.githubusercontent.com/u/32680606?v=4","gravatar_id":"","url":"https://api.github.com/users/Echeverrya","html_url":"https://github.com/Echeverrya","followers_url":"https://api.github.com/users/Echeverrya/followers","following_url":"https://api.github.com/users/Echeverrya/following{/other_user}","gists_url":"https://api.github.com/users/Echeverrya/gists{/gist_id}","starred_url":"https://api.github.com/users/Echeverrya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Echeverrya/subscriptions","organizations_url":"https://api.github.com/users/Echeverrya/orgs","repos_url":"https://api.github.com/users/Echeverrya/repos","events_url":"https://api.github.com/users/Echeverrya/events{/privacy}","received_events_url":"https://api.github.com/users/Echeverrya/received_events","type":"User","site_admin":false},"created_at":"2017-11-19T13:15:57Z","updated_at":"2017-11-19T13:15:57Z","author_association":"NONE","body":"Problem solved! This way above works pretty fine for registering users with a brypted password.\r\n\r\nI was creating another user with the same username which is not right."}}
{"actor":{"display_login":"Echeverrya"}}