carpe/elm-data/4.0.5

Rerouted (cache, verified). The original is gone. This copy comes from a Lamdera package cache made before it went. The Lamdera package server serves a copy recovered from a Lamdera package cache from 2021-02-13.

What we checked: Rebuilt from the unpacked sources in a Lamdera package cache (5 copies agree), which Elm only writes after the published SHA-1 checked out; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/carpe/elm-data/zipball/4.0.5/

ElmData.Jwt

Jwt module is a collection of helpers used to derive sessions from JWTs.

type alias JwtClaims =
{ issuer : String
, expiration : Int
, permissions : List String
}

Basic Jwt Claims. In the future this should be configurable.

checkToken : String -> (Result SessionFailure SessionData -> msg) -> Cmd msg

Checks a token for Expiry. Returns expiry or any errors that occurred in decoding.

scheduleExpiration : SessionData -> Int -> msg -> Cmd msg

Schedule a message to be sent any number of milliseconds BEFORE the JWT expires. You can use this to remind users that they may need to re-login soon, or to simply expire the session.