fork
Configure Feed
Select the types of activity you want to include in your feed.
A music player that connects to your cloud/distributed storage.
fork
Configure Feed
Select the types of activity you want to include in your feed.
1module Syncing.Services.Dropbox.Token exposing (..)
2
3import Time
4
5
6isExpired : { currentTime : Time.Posix, expiresAt : Int } -> Bool
7isExpired { currentTime, expiresAt } =
8 let
9 currentTimeInSeconds =
10 Time.posixToMillis currentTime // 1000
11
12 currentTimeWithOffset =
13 -- We add 60 seconds here because we only get the current time every minute,
14 -- so there's always the chance the "current time" is 1-60 seconds behind.
15 currentTimeInSeconds + 60
16 in
17 -- If the access token is expired
18 currentTimeWithOffset >= expiresAt