Making WordPress.org


Ignore:
Timestamp:
07/25/2023 04:07:53 AM (2 years ago)
Author:
dd32
Message:

Login: Don't override the login redirect location when it appears it'll go to the OIDC plugin used for Matrix.

This function is intended to prevent a post-login redirect langing on a login.wordpress.org page, except that OIDC expects this to occur.

This resolves a login issue with Chattrix on Make.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r12685 r12758  
    582582    // If the redirect is to a url that doesn't seem right, override it.
    583583    $redirect_host = parse_url( $redirect, PHP_URL_HOST );
     584    $redirect_qv   = parse_url( $redirect, PHP_URL_QUERY );
    584585    $proper_host   = parse_url( $_COOKIE['wporg_came_from'], PHP_URL_HOST );
    585586    if (
     
    591592                'login.wordpress.org',    // Default redirect for priv'd users.
    592593            ]
     594        ) &&
     595        // Don't override if the redirect is back to an OIDC destination.
     596        ! (
     597            'login.wordpress.org' == $redirect_host &&
     598            str_contains( $redirect_qv, 'response_type=code' )
    593599        )
    594600    ) {
Note: See TracChangeset for help on using the changeset viewer.