diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-17 15:11:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-17 15:11:44 +0000 |
commit | 3b9468e8b913d43f45e472b69b98c9da05f338bb (patch) | |
tree | a74e3d2a5b71a1e2a96c3751a04e9a78d36ee6f5 /config/initializers/doorkeeper.rb | |
parent | bb5c4817e58efb92d6be81e028d55adc9626e5da (diff) | |
download | gitlab-ce-3b9468e8b913d43f45e472b69b98c9da05f338bb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/initializers/doorkeeper.rb')
-rw-r--r-- | config/initializers/doorkeeper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 4533779339a..477d419576a 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -38,8 +38,11 @@ Doorkeeper.configure do # authorization_code_expires_in 10.minutes # Access token expiration time (default 2 hours). - # If you want to disable expiration, set this to nil. - access_token_expires_in nil + # Until 15.0, applications can opt-out of expiring tokens. + # Removal issue: https://gitlab.com/gitlab-org/gitlab/-/issues/340848 + custom_access_token_expires_in do |context| + context.client&.expire_access_tokens ? 2.hours : Float::INFINITY + end # Reuse access token for the same resource owner within an application (disabled by default) # Rationale: https://github.com/doorkeeper-gem/doorkeeper/issues/383 |