From 2f030d8ba9aeebe43ef845cfcd8aeac152621cb5 Mon Sep 17 00:00:00 2001 From: Philip Q Nguyen Date: Tue, 2 Feb 2021 09:33:01 -0800 Subject: [PATCH] Don't redirect to /serviceworker.js on sign in. (#12479) --- app/controllers/registrations_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 7852342e9..9ce064fc2 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -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