Modify authenticateUser to return an AuthenticationResult
Internally, use Either to propagate error messages that will
ultimately get logged in the case of failed authentications
Specifically parse credsExtra based on the plugin used
Separate plugin-specific behavior in implementation and test
Reasoning:
Using AuthenticationResult and returning useful ServerError values, should help
debugging. Splitting out the credsExtra parsing this way will making adding new
plugins (that return different credsExtra maps) easier. Supporting the dummy
plugin via dummyProfile makes it possible to write plugin-agnostic examples in
the test and only test plugin-specific behavior in the GitHub (and eventually
Google, Twitter, etc) contexts.
Reasoning:
Using AuthenticationResult and returning useful ServerError values, should help debugging. Splitting out the credsExtra parsing this way will making adding new plugins (that return different credsExtra maps) easier. Supporting the dummy plugin via dummyProfile makes it possible to write plugin-agnostic examples in the test and only test plugin-specific behavior in the GitHub (and eventually Google, Twitter, etc) contexts.