UrlParser for Auth0 token callback
Recommend o use this library with
[kkpoon/elm-auth0](https://github.com/kkpoon/elm-auth0).
Callback of Error
Create a token callback UrlParser
import UrlParser exposing (..)
import Auth0.UrlParser exposing (Auth0CallbackInfo, accessTokenUrlParser)
type Route
= AccessTokenRoute Auth0CallbackInfo
| SomeOtherRoute
route : Parser (Route -> a) a
route =
oneOf
[ map AccessTokenRoute accessTokenUrlParser
, map SomeOtherRoute (s "others")
]Create an error callback UrlParser
import UrlParser exposing (..)
import Auth0.UrlParser exposing (Auth0CallbackError, unauthorizedUrlParser)
type Route
= UnauthorizedRoute Auth0CallbackError
| SomeOtherRoute
route : Parser (Route -> a) a
route =
oneOf
[ map UnauthorizedRoute unauthorizedUrlParser
, map SomeOtherRoute (s "others")
]
Callback parameters from Auth0
If no
openidinscopeparameters in authorize request, no idToken return