diff options
Diffstat (limited to 'app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js')
-rw-r--r-- | app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js b/app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js index e617fecaa0f..1d47a9aed47 100644 --- a/app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js +++ b/app/assets/javascripts/pages/sessions/new/preserve_url_fragment.js @@ -12,7 +12,7 @@ export default function preserveUrlFragment(fragment = '') { // Append the fragment to all sign-in/sign-up form actions so it is preserved when the user is // eventually redirected back to the originally requested URL. - const forms = document.querySelectorAll('#signin-container form'); + const forms = document.querySelectorAll('#signin-container .tab-content form'); Array.prototype.forEach.call(forms, form => { const actionWithFragment = setUrlFragment(form.getAttribute('action'), `#${normalFragment}`); form.setAttribute('action', actionWithFragment); @@ -20,13 +20,13 @@ export default function preserveUrlFragment(fragment = '') { // Append a redirect_fragment query param to all oauth provider links. The redirect_fragment // query param will be available in the omniauth callback upon successful authentication - const anchors = document.querySelectorAll('#signin-container a.oauth-login'); - Array.prototype.forEach.call(anchors, anchor => { + const oauthForms = document.querySelectorAll('#signin-container .omniauth-container form'); + Array.prototype.forEach.call(oauthForms, oauthForm => { const newHref = mergeUrlParams( { redirect_fragment: normalFragment }, - anchor.getAttribute('href'), + oauthForm.getAttribute('action'), ); - anchor.setAttribute('href', newHref); + oauthForm.setAttribute('action', newHref); }); } } |