Skip to content

Commit

Permalink
6 mins ttl for user sessions
Browse files Browse the repository at this point in the history
Signed-off-by: manisha kumari <[email protected]>
  • Loading branch information
ManishaKumari295 committed Sep 17, 2024
1 parent edf94b0 commit 7ace887
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/store/etcd/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func (s *Store) GetSession(ctx context.Context, username, sessionID string) (str
}

// UpdateSession applies the supplied state to the session uniquely identified
// by the given username and session ID and TTL of 11 minutes
// by the given username and session ID and TTL of 6 minutes considering access token expires in 5 minutes
func (s *Store) UpdateSession(ctx context.Context, username, sessionID, state string) error {
leaseResp, err := s.client.Grant(ctx, 60*11)
leaseResp, err := s.client.Grant(ctx, 60*6)
if err != nil {
fmt.Errorf("%s", err)
}
Expand All @@ -48,6 +48,5 @@ func (s *Store) DeleteSession(ctx context.Context, username, sessionID string) e
if _, err := s.client.Delete(ctx, userSessionPath(username, sessionID)); err != nil {
return err
}

return nil
}

0 comments on commit 7ace887

Please sign in to comment.