carpe/elm-data/3.0.0

NOTE: the latest version is 4.0.5

Rerouted (archive, verified). The original repository is gone. This copy comes from an archive (Software Heritage). The Lamdera package server serves a copy recovered from swh:1:rev:3e69621927ad2e13a80ace7086775771b7585d49 (Software Heritage, origin https://github.com/carpe/elm-data).

What we checked: Software Heritage archived tag 3.0.0 of github.com/carpe/elm-data at commit 3e69621927ad; its commit 3e69621927ad is from 2020-02-29 23:37 UTC, before the version was published (2020-02-29 23:38 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, made from Software Heritage's copy of the files Elm uses, 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/3.0.0/

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.