diff options
author | Scott Escue <scott.escue@gmail.com> | 2018-06-04 16:30:59 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-01-10 00:00:39 -0600 |
commit | 6b067fe470857a478939a6037280beb07cf9680d (patch) | |
tree | 7e96d41025e592d9a97a1f113c7caf3e535cc388 /app/assets/javascripts/pages/sessions | |
parent | 4dcaa4df3622ae267363fcff184d0929b2102035 (diff) | |
download | gitlab-ce-6b067fe470857a478939a6037280beb07cf9680d.tar.gz |
Updating OAuthRememberMe to use new common utility functions when manipulating query parameters on OAuth buttons. This ensures the 'remember_me' parameter is safely added and removed when other query parameters are present.
Diffstat (limited to 'app/assets/javascripts/pages/sessions')
-rw-r--r-- | app/assets/javascripts/pages/sessions/new/oauth_remember_me.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/pages/sessions/new/oauth_remember_me.js b/app/assets/javascripts/pages/sessions/new/oauth_remember_me.js index 761618109a4..0c6ccd6e495 100644 --- a/app/assets/javascripts/pages/sessions/new/oauth_remember_me.js +++ b/app/assets/javascripts/pages/sessions/new/oauth_remember_me.js @@ -1,4 +1,5 @@ import $ from 'jquery'; +import { setUrlParam, removeUrlParam } from '~/lib/utils/common_utils'; /** * OAuth-based login buttons have a separate "remember me" checkbox. @@ -24,9 +25,9 @@ export default class OAuthRememberMe { const href = $(element).attr('href'); if (rememberMe) { - $(element).attr('href', `${href}?remember_me=1`); + $(element).attr('href', setUrlParam(href, 'remember_me', 1)); } else { - $(element).attr('href', href.replace('?remember_me=1', '')); + $(element).attr('href', removeUrlParam(href, 'remember_me')); } }); } |