|elm-version||0.18.0 <= v < 0.19.0|
|Committed At||2017-12-31 07:23:38 UTC|
A collection of functions to decode Jwt tokens, and to use them for authenticated CRUD requests.
A Jwt is a Base64 string that has three parts
* header * content * signature
The library functions
tokenDecoder provide the means to decode the content of a token, while
isExpired specifically analyse whether the token remains within its expiry time.
The library also provides modified versions of Elm standard Http functions to make CRUD requests with the Authorization header set to "bearer "
let url = "http://example.com/new" body = jsonBody <some Value> in Jwt.post token url body (Json.Decode.field "confirmation" Json.Decode.string)
Task JwtError Stringrather than
Task never (Result JwtError String). It is better to leave it to the user to handle the conversion to a Cmd. Elm 0.16 users should use version 1.0.2.