We now have a default implementation for it. See this for more
information:
https://github.com/yesodweb/yesod/issues/1489#issuecomment-370200663
Helps in preventing warnings like this:
```
serverside.hs:40:10: warning: [-Wmissing-methods]
• No explicit implementation for
‘authHttpManager’
• In the instance declaration for ‘YesodAuth App’
|
40 | instance YesodAuth App where
| ^^^^^^^^^^^^^
```
This is much more consistent than suddenly using a ReaderT for subsites.
Thanks to @jprider63 for the inspiration for this, I think it cleans
things up a lot!
* extend docs of defaultMaybeAuthId
make more explicite that on each call a database access is done. This can be of relevance and sometimes redundant with other Handler functionality
* Update Auth.hs
- getAuthId returns Maybe AuthId with no useful information in the
Nothing case.
- AuthenticationResult includes whether it was a User or Server error
(with an accompanying message) in the failure case.
- User errors are displayed back to the user and have a 401 status in
JSON responses. Server errors are logged and a generic error message
is presented to the user, with a 500 status in JSON responses.
Resolves#956
`AuthEntity` is now a type family associated to the `YesodAuthPersist`
class, so its old type alias definition has now become its default type
instance, which allows recovering the old behavior with minimal
boilerplate: an empty instance declaration for `YesodAuthPersist` makes
a Yesod application written with Persistent work just like before.
Unfortunately, this requires enabling `UndecidableInstances` in the
`Yesod.Auth` module since there is now a nested type family application
(as `AuthEntity` is now itself a type family).
This was tested with the scaffolded application with PostgreSQL, and it
works (given another small change to make it work with Persistent 2 due
to how `SqlPersistT` is now defined).
`maybeAuth` and `requireAuth` have been reverted to their original
signatures, which assume a Persistent database. `maybeAuthPair` and
`requireAuthPair` are introduced, which do the same but without that
assumption.