Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: always set ticket expires at as it can't be null #588

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go/controller/post_signin_idtoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func TestPostSigninIdToken(t *testing.T) { //nolint:maintidx
AvatarUrl: "https://myapp.local/jane.jpg",
Email: sql.Text("jane@myapp.local"),
Ticket: sql.Text(""),
TicketExpiresAt: pgtype.Timestamptz{}, //nolint:exhaustruct
TicketExpiresAt: sql.TimestampTz(time.Now()),
EmailVerified: true,
Locale: "en",
DefaultRole: "user",
Expand Down Expand Up @@ -467,7 +467,7 @@ func TestPostSigninIdToken(t *testing.T) { //nolint:maintidx
TotpSecret: pgtype.Text{},
ActiveMfaType: pgtype.Text{},
Ticket: pgtype.Text{},
TicketExpiresAt: pgtype.Timestamptz{},
TicketExpiresAt: sql.TimestampTz(time.Now()),
Metadata: []byte{},
WebauthnCurrentChallenge: pgtype.Text{},
}, nil)
Expand Down Expand Up @@ -601,7 +601,7 @@ func TestPostSigninIdToken(t *testing.T) { //nolint:maintidx
TotpSecret: pgtype.Text{},
ActiveMfaType: pgtype.Text{},
Ticket: pgtype.Text{},
TicketExpiresAt: pgtype.Timestamptz{},
TicketExpiresAt: sql.TimestampTz(time.Now()),
Metadata: []byte{},
WebauthnCurrentChallenge: pgtype.Text{},
}, nil)
Expand Down Expand Up @@ -730,7 +730,7 @@ func TestPostSigninIdToken(t *testing.T) { //nolint:maintidx
TotpSecret: pgtype.Text{},
ActiveMfaType: pgtype.Text{},
Ticket: pgtype.Text{},
TicketExpiresAt: pgtype.Timestamptz{},
TicketExpiresAt: sql.TimestampTz(time.Now()),
Metadata: []byte{},
WebauthnCurrentChallenge: pgtype.Text{},
}, nil)
Expand Down
2 changes: 1 addition & 1 deletion go/controller/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func (wf *Workflows) #UserWithouthSession(
gravatarURL := wf.gravatarURL(email)

var ticket pgtype.Text
var ticketExpiresAt pgtype.Timestamptz
ticketExpiresAt := sql.TimestampTz(time.Now())
if sendConfirmationEmail {
ticket = sql.Text(generateTicket(TicketTypeVerifyEmail))
ticketExpiresAt = sql.TimestampTz(time.Now().Add(InAMonth))
Expand Down