Skip to content

Commit

Permalink
Use a guard check instead of wrapping the whole method body
Browse files Browse the repository at this point in the history
Appeasing Rubocop in the process.
  • Loading branch information
elia committed Jan 12, 2023
1 parent ee8cb5c commit f4f4086
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/lib/spree/core/controller_helpers/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def redirect_back_or_default(default)
end

def set_guest_token
unless cookies.signed[:guest_token].present?
cookies.permanent.signed[:guest_token] = Spree::Config[:guest_token_cookie_options].merge(
value: SecureRandom.urlsafe_base64(nil, false),
httponly: true
)
end
return if cookies.signed[:guest_token].present?

cookies.permanent.signed[:guest_token] = Spree::Config[:guest_token_cookie_options].merge(
value: SecureRandom.urlsafe_base64(nil, false),
httponly: true
)
end

def store_location
Expand Down

0 comments on commit f4f4086

Please sign in to comment.