{"action":"created","issue":{"url":"https://api.github.com/repos/ruma/ruma/issues/142","repository_url":"https://api.github.com/repos/ruma/ruma","labels_url":"https://api.github.com/repos/ruma/ruma/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/ruma/ruma/issues/142/comments","events_url":"https://api.github.com/repos/ruma/ruma/issues/142/events","html_url":"https://github.com/ruma/ruma/issues/142","id":198229116,"number":142,"title":"If `User` already exists & `User` login","user":{"login":"impowski","id":6883168,"avatar_url":"https://avatars.githubusercontent.com/u/6883168?v=3","gravatar_id":"","url":"https://api.github.com/users/impowski","html_url":"https://github.com/impowski","followers_url":"https://api.github.com/users/impowski/followers","following_url":"https://api.github.com/users/impowski/following{/other_user}","gists_url":"https://api.github.com/users/impowski/gists{/gist_id}","starred_url":"https://api.github.com/users/impowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impowski/subscriptions","organizations_url":"https://api.github.com/users/impowski/orgs","repos_url":"https://api.github.com/users/impowski/repos","events_url":"https://api.github.com/users/impowski/events{/privacy}","received_events_url":"https://api.github.com/users/impowski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-31T11:36:28Z","updated_at":"2016-12-31T18:56:58Z","closed_at":null,"body":"1. I was looking at this project like an example for understanding Iron and other things and I spot such problem that there is no check if user is already registered. \r\n2. And I was quite frustrated when I was looking at login API, because for example: when we trying to access some profile which not exists we get a `not_found` error since we do a check inside of [`api/r0/profile.rs`](https://github.com/ruma/ruma/blob/master/src/api/r0/profile.rs#L38), but there is no such thing for `User` because when we are trying to verify our `User` with `verify` inside of [`model/user.rs`](https://github.com/ruma/ruma/blob/master/src/models/user.rs#L79) and we call another function `find_by_uid` inside of it which doesn't return `DieselError::NotFound` and there is no test for invalid credentials inside of login too. And my question is does it even return `DieselError` because seems like no?\r\n\r\nIn case this will be true I could implement those things.\r\n\r\nP.S.\r\nMaybe I'm wrong in some cases because I use Ruma as an example to write my own thing."},"comment":{"url":"https://api.github.com/repos/ruma/ruma/issues/comments/269877855","html_url":"https://github.com/ruma/ruma/issues/142#issuecomment-269877855","issue_url":"https://api.github.com/repos/ruma/ruma/issues/142","id":269877855,"user":{"login":"mujx","id":6430350,"avatar_url":"https://avatars.githubusercontent.com/u/6430350?v=3","gravatar_id":"","url":"https://api.github.com/users/mujx","html_url":"https://github.com/mujx","followers_url":"https://api.github.com/users/mujx/followers","following_url":"https://api.github.com/users/mujx/following{/other_user}","gists_url":"https://api.github.com/users/mujx/gists{/gist_id}","starred_url":"https://api.github.com/users/mujx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujx/subscriptions","organizations_url":"https://api.github.com/users/mujx/orgs","repos_url":"https://api.github.com/users/mujx/repos","events_url":"https://api.github.com/users/mujx/events{/privacy}","received_events_url":"https://api.github.com/users/mujx/received_events","type":"User","site_admin":false},"created_at":"2016-12-31T18:56:58Z","updated_at":"2016-12-31T18:56:58Z","body":"It returns `Forbidden`, because technically you submit invalid credentials. `NotFound` could also be correct. It depends on whether or not you want to give info about the existence of a user."}}
{"actor":{"display_login":"mujx"}}