new setting allows administrator to determine if users should be redirected when their acces token expires.

isekai
Jonathan Daggerhart 7 years ago
parent cdf2629aa3
commit c73d9f6956

@ -159,7 +159,10 @@ class OpenID_Connect_Generic_Client_Wrapper {
if ( ! $refresh_token ) {
wp_logout();
$this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.' ) ) );
if ( $this->settings->redirect_on_logout ) {
$this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.' ) ) );
}
}
$token_result = $this->client->request_new_tokens( $refresh_token );

@ -163,6 +163,12 @@ class OpenID_Connect_Generic_Settings_Page {
'type' => 'checkbox',
'section' => 'user_settings',
),
'redirect_on_logout' => array(
'title' => __( 'Redirect to the login screen session is expired' ),
'description' => __( 'When enabled, this will automatically redirect the user back to the WordPress login page if their access token has expired.' ),
'type' => 'checkbox',
'section' => 'user_settings',
),
'enable_logging' => array(
'title' => __( 'Enable Logging' ),
'description' => __( 'Very simple log messages for debugging purposes.' ),

@ -207,8 +207,9 @@ class OpenID_Connect_Generic {
'alternate_redirect_uri' => 0,
'link_existing_users' => 0,
'redirect_user_back' => 0,
'redirect_on_logout' => 1,
'enable_logging' => 0,
'log_limit' => 1000,
'log_limit' => 1000,
)
);

Loading…
Cancel
Save