Don't redirect to /serviceworker.js on sign in. (#12479)

This commit is contained in:
Philip Q Nguyen 2021-02-02 09:33:01 -08:00 committed by GitHub
parent 2f51f47dd1
commit 2f030d8ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,8 @@ class RegistrationsController < Devise::RegistrationsController
if user_signed_in?
redirect_to root_path(signin: "true")
else
if URI(request.referer || "").host == URI(request.base_url).host
referer_path = URI(request.referer || "").path
if URI(request.referer || "").host == URI(request.base_url).host && referer_path != "/serviceworker.js"
store_location_for(:user, request.referer)
end
super