forked from tangled.org/core
this repo has no description

simplify time in few places

Changed files
+2 -4
appview
+1 -1
appview/auth/auth.go
··· 145 145 clientSession.Values[appview.SessionPds] = pdsEndpoint 146 146 clientSession.Values[appview.SessionAccessJwt] = atSessionish.GetAccessJwt() 147 147 clientSession.Values[appview.SessionRefreshJwt] = atSessionish.GetRefreshJwt() 148 - clientSession.Values[appview.SessionExpiry] = time.Now().Add(time.Hour).Format(appview.TimeLayout) 148 + clientSession.Values[appview.SessionExpiry] = time.Now().Add(time.Hour).Format(time.RFC3339) 149 149 clientSession.Values[appview.SessionAuthenticated] = true 150 150 return clientSession.Save(r, w) 151 151 }
-1
appview/consts.go
··· 10 10 SessionRefreshJwt = "refreshJwt" 11 11 SessionExpiry = "expiry" 12 12 SessionAuthenticated = "authenticated" 13 - TimeLayout = "2006-01-02 15:04:05.999999999 -0700 MST" 14 13 SqliteDbPath = "appview.db" 15 14 )
+1 -1
appview/state/middleware.go
··· 28 28 // refresh if nearing expiry 29 29 // TODO: dedup with /login 30 30 expiryStr := session.Values[appview.SessionExpiry].(string) 31 - expiry, err := time.Parse(appview.TimeLayout, expiryStr) 31 + expiry, err := time.Parse(time.RFC3339, expiryStr) 32 32 if err != nil { 33 33 log.Println("invalid expiry time", err) 34 34 return
-1
appview/state/state.go
··· 16 16 lexutil "github.com/bluesky-social/indigo/lex/util" 17 17 "github.com/gliderlabs/ssh" 18 18 "github.com/go-chi/chi/v5" 19 - "github.com/google/uuid" 20 19 tangled "github.com/sotangled/tangled/api/tangled" 21 20 "github.com/sotangled/tangled/appview" 22 21 "github.com/sotangled/tangled/appview/auth"