Shorten the authorization code lifetime to 60 seconds
CI / Test (pull_request) Failing after 48s

The code is redeemed by the client immediately in the OAuth callback, so
a 60-second window is plenty (and matches common practice; RFC 6749 caps
authorization codes at 10 minutes).

Part of #254
This commit is contained in:
raucao committed 2026-11-03 08:07:34 +04:00
1 parent 8fc7ffdd1d
commit a373e577dc
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
class RsAuthorizationCode < ApplicationRecord
belongs_to :user
CODE_TTL = 5.minutes
CODE_TTL = 60.seconds
serialize :permissions, coder: YAML
+1 -1
View File
@@ -25,7 +25,7 @@ RSpec.describe RsAuthorizationCode, type: :model do
it "sets a short expiry" do
code = build_code
expect(code.expires_at).to be_within(5.seconds).of(5.minutes.from_now)
expect(code.expires_at).to be_within(5.seconds).of(60.seconds.from_now)
end
end