[BUGFIX] Clear inputs when switching between OpenID and normal login 80/38680/4
authorChristian Weiske <christian.weiske@netresearch.de>
Tue, 14 Apr 2015 06:50:27 +0000 (08:50 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Wed, 15 Apr 2015 09:29:10 +0000 (11:29 +0200)
Browsers auto-fill username + password, and when switching to
OpenID login those fields were still submitted and used to log
into TYPO3.

By clearing them unconditionally, we're sure that they do not get
used to log the user into TYPO3.

Change-Id: Ief908829826c65345f034e0763cbbd845452907c
Fixes: #66404
Releases: master
Reviewed-on: http://review.typo3.org/38680
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/Login.js

index 6cc2812..bfde65a 100755 (executable)
@@ -61,9 +61,8 @@ define('TYPO3/CMS/Backend/Login', ['jquery'], function($) {
                $('#t3-login-interface-section').hide();
 
                $(options.openIdField).trigger('focus');
-               if ($(options.usernameField).val() == '') {
-                       $(options.usernameField).val('openid_url');
-               }
+               $(options.usernameField).val('openid_url');
+               $(options.passwordField).val('');
 
                BackendLogin.setLogintypeCookie('openid');
        };
@@ -74,9 +73,9 @@ define('TYPO3/CMS/Backend/Login', ['jquery'], function($) {
        BackendLogin.switchToDefault = function() {
                $('#t3-login-openIdLogo').hide();
 
-               if ($(options.usernameField).val() == 'openid_url') {
-                       $(options.usernameField).val('');
-               }
+               $(options.openIdField).val('');
+               $(options.usernameField).val('');
+
 
                $('#t3-login-form-footer-default').show();
                $('#t3-login-form-footer-openId').hide();