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:
2 files changed
+2
-2
No files matched your search
@@ -1,7 +1,7 @@
|
||||
class RsAuthorizationCode < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
||||
CODE_TTL = 5.minutes
|
||||
CODE_TTL = 60.seconds
|
||||
|
||||
serialize :permissions, coder: YAML
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user