Skip to content

Commit

Permalink
fix: nil memoization (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastronleroux authored Dec 10, 2024
1 parent cb55641 commit c562260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/devise/api/tokens_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def call_devise_trackable!(resource_owner)
end

def current_devise_api_refresh_token
return @current_devise_api_refresh_token if @current_devise_api_refresh_token
return @current_devise_api_refresh_token if defined?(@current_devise_api_refresh_token)

token = find_devise_api_token
devise_api_token_model = Devise.api.config.base_token_model.constantize
Expand Down
2 changes: 1 addition & 1 deletion lib/devise/api/controllers/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def current_devise_api_refresh_token
end

def current_devise_api_token
return @current_devise_api_token if @current_devise_api_token
return @current_devise_api_token if defined?(@current_devise_api_token)

token = find_devise_api_token
devise_api_token_model = Devise.api.config.base_token_model.constantize
Expand Down

0 comments on commit c562260

Please sign in to comment.