{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/yesod/issues/956","labels_url":"https://api.github.com/repos/yesodweb/yesod/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/yesod/issues/956/comments","events_url":"https://api.github.com/repos/yesodweb/yesod/issues/956/events","html_url":"https://github.com/yesodweb/yesod/issues/956","id":62116826,"number":956,"title":"getAuthId to return a more useful result","user":{"login":"pbrisbin","id":50812,"avatar_url":"https://avatars.githubusercontent.com/u/50812?v=3","gravatar_id":"","url":"https://api.github.com/users/pbrisbin","html_url":"https://github.com/pbrisbin","followers_url":"https://api.github.com/users/pbrisbin/followers","following_url":"https://api.github.com/users/pbrisbin/following{/other_user}","gists_url":"https://api.github.com/users/pbrisbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pbrisbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbrisbin/subscriptions","organizations_url":"https://api.github.com/users/pbrisbin/orgs","repos_url":"https://api.github.com/users/pbrisbin/repos","events_url":"https://api.github.com/users/pbrisbin/events{/privacy}","received_events_url":"https://api.github.com/users/pbrisbin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-16T15:31:35Z","updated_at":"2015-03-16T19:00:11Z","closed_at":null,"body":"When I'm unable to authenticate a user based on some `Creds`, the only information I really have is that `getAuthId` returned `Nothing` and the page shows \"Invalid login\". I frequently have to debug `getAuthId`, when a more informative return value could have told me directly what was going on.\r\n\r\nThe simplest thing would be to upgrade the `Maybe` to `Either`, but then we'd have to decide if that `Left` message is intended for a developer or the end-user. We could return something like:\r\n\r\n```haskell\r\ndata AuthResult\r\n    = Success UserId\r\n    | UserError Message -- User's fault, show them message\r\n    | ServerError Message -- Server's fault, log message, show user \"Sorry\" or something\r\n```\r\n\r\nObviously this is a breaking change, but I wanted to put it out there and start the discussion. I could handle my own use case in a few other ways (exceptions, logging, etc), but this felt like a Good Idea in general."},"comment":{"url":"https://api.github.com/repos/yesodweb/yesod/issues/comments/81872997","html_url":"https://github.com/yesodweb/yesod/issues/956#issuecomment-81872997","issue_url":"https://api.github.com/repos/yesodweb/yesod/issues/956","id":81872997,"user":{"login":"MaxGabriel","id":1274145,"avatar_url":"https://avatars.githubusercontent.com/u/1274145?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxGabriel","html_url":"https://github.com/MaxGabriel","followers_url":"https://api.github.com/users/MaxGabriel/followers","following_url":"https://api.github.com/users/MaxGabriel/following{/other_user}","gists_url":"https://api.github.com/users/MaxGabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGabriel/subscriptions","organizations_url":"https://api.github.com/users/MaxGabriel/orgs","repos_url":"https://api.github.com/users/MaxGabriel/repos","events_url":"https://api.github.com/users/MaxGabriel/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGabriel/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T19:00:11Z","updated_at":"2015-03-16T19:00:11Z","body":"You could add new API to return the `AuthResult`, leaving the `getAuthId` API the same, right?"}}