Contacts for Support
This is an API specification for authentication of Elm apps.
The idea here is to capture the interaction with a typical authentication API as an Elm package and to present that as a simpler API that applications need authentication can make use of. The core of the API is the authentication commands, which are:
login : Credentials -> Cmd msg
refresh : Cmd msg
logout : Cmd msg
unauthed : Cmd msgThe commands yield messages that must be given to an update function which has
this signature and related types:
type Status chal
= Failed
| Challenged chal
| LoggedOut
| LoggedIn
{ scopes : List String
, subject : String
}
update : msg -> model -> ( model, Cmd msg, Maybe (Status chal))That is, each message will update the internal model, and may produce a change to the current authentication status.