Skip to content

Commit 0e41bb4

Browse files
committed
Use a guard check instead of wrapping the whole method body
Appeasing Rubocop in the process.
1 parent eac5f29 commit 0e41bb4

File tree

1 file changed

+6
-6
lines changed
  • core/lib/spree/core/controller_helpers

1 file changed

+6
-6
lines changed

core/lib/spree/core/controller_helpers/auth.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ def redirect_back_or_default(default)
4242
end
4343

4444
def set_guest_token
45-
unless cookies.signed[:guest_token].present?
46-
cookies.permanent.signed[:guest_token] = Spree::Config[:guest_token_cookie_options].merge(
47-
value: SecureRandom.urlsafe_base64(nil, false),
48-
httponly: true
49-
)
50-
end
45+
return if cookies.signed[:guest_token].present?
46+
47+
cookies.permanent.signed[:guest_token] = Spree::Config[:guest_token_cookie_options].merge(
48+
value: SecureRandom.urlsafe_base64(nil, false),
49+
httponly: true
50+
)
5151
end
5252

5353
def store_location

0 commit comments

Comments
 (0)