Making WordPress.org

Changeset 12578


Ignore:
Timestamp:
05/08/2023 05:46:57 AM (3 years ago)
Author:
dd32
Message:

Login: SSO: Allow for the 2FA revalidate_2fa to be presented on other origins.

See ​https://github.com/WordPress/wporg-two-factor/pull/147.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r12556 r12578  
    283283                                        // Allow logout to process. See self::login_form_logout()
    284284                                        if ( isset( $_GET['action'] ) && empty( $_POST ) && 'logout' == $_GET['action'] ) {
     285                                                return;
     286                                        }
     287
     288                                        // Don't redirect the 2fa 'revalidate_2fa' handler to login.wordpress.org when presented on WordPress.org
     289                                        if ( isset( $_REQUEST['action'] ) && 'revalidate_2fa' == $_REQUEST['action'] ) {
    285290                                                return;
    286291                                        }
    … …  
    421426                        }
    422427
     428                        // Don't alter the revalidate 2fa form.
     429                        if ( str_contains( $url, 'wp-login.php?action=revalidate_2fa' ) ) {
     430                                return $url;
     431                        }
     432
    423433                        return $this->sso_host_url . '/wp-login.php';
    424434                }
Note: See TracChangeset for help on using the changeset viewer.