Skip to content

Commit

Permalink
fix(be): do not expire session for demo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Aug 26, 2023
1 parent aee3b81 commit d9a0a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func authenticationHandler(w http.ResponseWriter, r *http.Request) bool {
return false
}

if time.Since(session.LastActive).Hours() > 7*24 {
if time.Since(session.LastActive).Hours() > 7*24 && !util.Config.DemoMode {
// more than week old unused session
// destroy.
if err := helpers.Store(r).ExpireSession(userID, sessionID); err != nil {
Expand Down Expand Up @@ -119,7 +119,7 @@ func authenticationWithStore(next http.Handler) http.Handler {
store := helpers.Store(r)

var ok bool

db.StoreSession(store, r.URL.String(), func() {
ok = authenticationHandler(w, r)
})
Expand Down

0 comments on commit d9a0a4d

Please sign in to comment.