Skip to content

Commit a4c692f

Browse files
authored
fix: convert refreshed_at to UTC before updating (#1916)
1 parent f72f0ee commit a4c692f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/models/sessions.go

+4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ func (s *Session) LastRefreshedAt(refreshTokenTime *time.Time) time.Time {
103103
}
104104

105105
func (s *Session) UpdateOnlyRefreshInfo(tx *storage.Connection) error {
106+
// TODO(kangmingtay): The underlying database type uses timestamp without timezone,
107+
// so we need to convert the value to UTC before updating it.
108+
// In the future, we should add a migration to update the type to contain the timezone.
109+
*s.RefreshedAt = s.RefreshedAt.UTC()
106110
return tx.UpdateOnly(s, "refreshed_at", "user_agent", "ip")
107111
}
108112

0 commit comments

Comments
 (0)