allow developers to use the plain auth url by shortcode (#98)

* allow developers to use the plain auth url by shortcode

* prevent to set the redirect cookie on every page request by moving the function call to the formular rendering.
isekai
cswebservice 6 years ago committed by Jonathan Daggerhart
parent 87470689db
commit 54f3ff4193

@ -29,7 +29,6 @@ class OpenID_Connect_Generic_Login_Form {
// add a shortcode for the login button
add_shortcode( 'openid_connect_generic_login_button', array( $login_form, 'make_login_button' ) );
$login_form->handle_redirect_cookie();
$login_form->handle_redirect_login_type_auto();
return $login_form;
@ -128,6 +127,9 @@ class OpenID_Connect_Generic_Login_Form {
$text = apply_filters( 'openid-connect-generic-login-button-text', __( 'Login with OpenID Connect' ) );
$href = $this->client_wrapper->get_authentication_url();
// maybe set redirect cookie on formular page
$this->handle_redirect_cookie();
ob_start();
?>
<div class="openid-connect-login-button" style="margin: 1em 0; text-align: center;">

@ -102,6 +102,9 @@ class OpenID_Connect_Generic {
$this->client_wrapper = OpenID_Connect_Generic_Client_Wrapper::register( $this->client, $this->settings, $this->logger );
$this->login_form = OpenID_Connect_Generic_Login_Form::register( $this->settings, $this->client_wrapper );
// add a shortcode to get the auth url
add_shortcode( 'openid_connect_generic_auth_url', array( $this->client_wrapper, 'get_authentication_url' ) );
$this->upgrade();
if ( is_admin() ){

Loading…
Cancel
Save