]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1578805 - When changing password or enabling 2fa, previous sessions should be...
authorDavid Lawrence <dkl@mozilla.com>
Fri, 6 Sep 2019 15:39:40 +0000 (11:39 -0400)
committerDavid Lawrence <dkl@mozilla.com>
Fri, 6 Sep 2019 15:39:40 +0000 (11:39 -0400)
template/en/default/account/prefs/account.html.tmpl
template/en/default/account/prefs/mfa.html.tmpl
userprefs.cgi

index 64501eef68c3a1420893c0967dd5fc0f72cecd2f..db8633751df55ec3bfe1c55f23995e81776c5a49 100644 (file)
             [% Param('passwdqc_desc') FILTER html_light %]
           </td>
           </tr>
+          <tr>
+          <td>&nbsp;</td>
+          <td>
+            <em>Warning:</em> Changing your password will automatically log out
+            other login sessions except for the current one.
+          </td>
+          </tr>
           <tr>
             <th align="right">New password:</th>
             <td>
index 8185a91bb691ab5675244e7c36dd8c952efe510c..66702ae4d2df717d80dcf7044a33a1e276c2f68c 100644 (file)
       <a href="[% basepath FILTER none %]userprefs.cgi?tab=settings#api_key_only">Require API key authentication for API requests</a>
       preference after 2FA is enabled.
     </p>
+
+    <p>
+      <em>Warning:</em> Changing your Two-factor authentication settings will
+      automatically log out other login sessions except for the current one.
+    </p>
+
   </div>
 
 </div>
index fdd921536f669597b14f8af74ac5ba576d090cf9..e2127fe4326eae9a5c7836d8933ead45af45b04b 100755 (executable)
@@ -742,6 +742,11 @@ sub SaveMFAupdate {
     $user->update({keep_session => 1, keep_tokens => 1});
 
   }
+
+  # Invalidate all logins except for the current one
+  if ($action eq 'enable' || $action eq 'disable') {
+    Bugzilla->logout(LOGOUT_KEEP_CURRENT);
+  }
 }
 
 sub SaveMFAcallback {