diff --git a/session.go b/session.go index 10d856924..9c810cd9a 100644 --- a/session.go +++ b/session.go @@ -52,9 +52,6 @@ func (s *DefaultSession) GetExpiresAt(key TokenType) time.Time { s.ExpiresAt = make(map[TokenType]time.Time) } - if _, ok := s.ExpiresAt[key]; !ok { - return time.Time{} - } return s.ExpiresAt[key] } diff --git a/session_test.go b/session_test.go index 0a4a85b8e..a3e1ac17d 100644 --- a/session_test.go +++ b/session_test.go @@ -15,3 +15,11 @@ func TestSession(t *testing.T) { assert.Empty(t, s.GetUsername()) assert.Nil(t, s.Clone()) } + +func TestZeroSession(t *testing.T) { + var s *DefaultSession = new(DefaultSession) + assert.Empty(t, s.GetSubject()) + assert.Empty(t, s.GetUsername()) + assert.Empty(t, s.Clone()) + assert.Empty(t, s.GetExpiresAt(AccessToken)) +}