Sounds like you need this function 
http://package.elm-lang.org/packages/simonh1000/elm-jwt/5.0.0/Jwt#isExpired

If there is something missing in elm-jwt, let  me know and I'll see if it 
can be added (or you could send a PR)

On Sunday, 2 April 2017 05:44:29 UTC+2, Richard Wood wrote:
>
> Hi All
>
> I'm working on a base application involving authentication, Auth0 and AWS 
> access. There's a lot of useful starter scripts and examples around - hats 
> off to the community - so I'm basically pulling stuff together for 
> server-less projects and so I can learn elm and authentication.
>
> I'd be keen for anyone to have a look and give me some feedback:
> Elm repository https://github.com/rwoodnz/elm-base
> AWS repository https://github.com/rwoodnz/aws-base
>
> *My question*
> On entry I pop up the Auth0 lock if the user has not got an existing 
> token. My next stage is to add a check or checks for Token expiry. I want 
> to do that in the code and not make a call to Auth0 or rely on a bad 
> response from the API.
>
> I've found the very useful-looking JWT library and the Time functionality 
> and am trying not to despair at the amount of code it may take!
>
> Is there a simpler way? Should I just port out to Javascript as it would 
> only be a little function there? I'm really trying to avoid that in 
> principle and so as to force my Elm learning.
>
> Richard
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to