Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filter to allow for changing the output of die_on_login #593

Merged
merged 1 commit into from
Dec 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions lib/WP_Auth0_LoginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,23 +760,24 @@ protected function get_state() {
* @param bool $login_link - TRUE for login link, FALSE for logout link.
*/
protected function die_on_login( $msg = '', $code = 0, $login_link = true ) {
wp_die(
sprintf(
'%s: %s [%s: %s]<br><br><a href="%s">%s</a>',
$login_link
? __( 'There was a problem with your log in', 'wp-auth0' )
: __( 'You have logged in successfully, but there is a problem accessing this site', 'wp-auth0' ),
! empty( $msg )
? sanitize_text_field( $msg )
: __( 'Please see the site administrator', 'wp-auth0' ),
__( 'error code', 'wp-auth0' ),
$code ? sanitize_text_field( $code ) : __( 'unknown', 'wp-auth0' ),
$login_link ? add_query_arg( 'skip_sso', '', wp_login_url() ) : wp_logout_url(),
$login_link
? __( '← Login', 'wp-auth0' )
: __( '← Logout', 'wp-auth0' )
)
$html = sprintf(
'%s: %s [%s: %s]<br><br><a href="%s">%s</a>',
$login_link
? __( 'There was a problem with your log in', 'wp-auth0' )
: __( 'You have logged in successfully, but there is a problem accessing this site', 'wp-auth0' ),
! empty( $msg )
? sanitize_text_field( $msg )
: __( 'Please see the site administrator', 'wp-auth0' ),
__( 'error code', 'wp-auth0' ),
$code ? sanitize_text_field( $code ) : __( 'unknown', 'wp-auth0' ),
$login_link ? add_query_arg( 'skip_sso', '', wp_login_url() ) : wp_logout_url(),
$login_link
? __( '← Login', 'wp-auth0' )
: __( '← Logout', 'wp-auth0' )
);

$html = apply_filters( 'auth0_die_on_login_output', $html, $msg, $code, $login_link );
wp_die( $html );
}

/**
Expand Down