This is a quick fix for PR#1524.
Currently, defining `emailPreviouslyRegisteredResponse` will prevent
`sendConfirmationEmail` from happening, even when `registerHelper` is
called from `postForgotPasswordR`.
The behavior of `registerHelper` when an email that is already-verified
tries to register is now configurable via the
`emailPreviouslyRegisteredResponse` method of the `YesodAuthEmail`
typeclass.
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
This change introduces `hashAndSaltPassword` and `verifyPassword` to the
`YesodAuthEmail` type class, allowing users to implement their own hashing
schemes (i.e. to provide compatibility with an existing database). It also
updates the default handlers to use these new functions when appropriate. The
functions have default implementation such that behavior for legacy applications
should not change.
Since the other type signatures of the typeclass has VerKey instead of
Text, it would be better to use VerKey here also to maintain
consistency. Also, IMO this signature is more easy to follow ( I had to
look at source to see how the verification key was generated. )