Skip to content

Commit

Permalink
More user API token creation fixes (#1269)
Browse files Browse the repository at this point in the history
* More user API token creation fixes

* Don't load dotenv-rails in the test env
  • Loading branch information
Dantemss authored Oct 23, 2024
1 parent 8e6f007 commit bd79095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ gem 'psych', '< 4'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

# Get env variables from .env file
gem 'dotenv-rails'

# Threaded application server
gem 'puma'

Expand Down Expand Up @@ -190,6 +187,11 @@ gem 'rack-cors'
# Data visualization and query
gem 'blazer'

group :development, :production do
# Get env variables from .env file
gem 'dotenv-rails'
end

group :development, :test do
# Run specs in parallel
gem 'parallel_tests'
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def create_external_id
def get_sso_token(application, user)
access_token = Doorkeeper::AccessToken.find_or_create_for(
application: application,
resource_owner: user.id,
resource_owner: user,
scopes: Doorkeeper.config.default_scopes,
expires_in: SSO_TOKEN_INITIAL_DURATION,
use_refresh_token: false,
Expand All @@ -276,8 +276,8 @@ def get_sso_token(application, user)
)

access_token = Doorkeeper::AccessToken.create_for(
application: application.id,
resource_owner: user.id,
application: application,
resource_owner: user,
scopes: Doorkeeper.config.default_scopes,
expires_in: SSO_TOKEN_INITIAL_DURATION,
use_refresh_token: false
Expand Down

0 comments on commit bd79095

Please sign in to comment.