Skip to content

Commit

Permalink
fix: write device_code expiration in session
Browse files Browse the repository at this point in the history
  • Loading branch information
nsklikas committed Jan 24, 2025
1 parent 1f15315 commit b77efc3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions handler/rfc8628/auth_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (d *DeviceAuthHandler) handleDeviceAuthSession(ctx context.Context, dar fos
}

dar.GetSession().SetExpiresAt(fosite.UserCode, time.Now().UTC().Add(d.Config.GetDeviceAndUserCodeLifespan(ctx)).Round(time.Second))
dar.GetSession().SetExpiresAt(fosite.DeviceCode, time.Now().UTC().Add(d.Config.GetDeviceAndUserCodeLifespan(ctx)).Round(time.Second))
// Note: the retries are added here because we need to ensure uniqueness of user codes.
// The chances of duplicates should however be diminishing, because they are the same
// chance an attacker will be able to hit a valid code with few guesses. However, as
Expand Down

0 comments on commit b77efc3

Please sign in to comment.