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

Rename the Auto Login setting to ULP; move to features tab #551

Merged
merged 3 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 3 additions & 35 deletions lib/admin/WP_Auth0_Admin_Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ public function init() {
'id' => 'wpa0_auto_login',
'function' => 'render_auto_login',
),
array(
'name' => __( 'Auto Login Method', 'wp-auth0' ),
'opt' => 'auto_login_method',
'id' => 'wpa0_auto_login_method',
'function' => 'render_auto_login_method',
),
array(
'name' => __( 'Implicit Login Flow', 'wp-auth0' ),
'opt' => 'auth0_implicit_workflow',
Expand Down Expand Up @@ -434,38 +428,12 @@ public function render_migration_ws_ips( $args = array() ) {
}

/**
* Render form field and description for the `auto_login` option.
* Refer to the Features tab for the `auto_login` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*/
public function render_auto_login( $args = array() ) {
$this->render_switch( $args['label_for'], $args['opt_name'], 'wpa0_auto_login_method' );
public function render_auto_login() {
$this->render_field_description(
__( 'Send logins directly to a specific Connection, skipping the login page', 'wp-auth0' )
);
}

/**
* Render form field and description for the `auto_login_method` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*/
public function render_auto_login_method( $args = array() ) {
$this->render_text_field( $args['label_for'], $args['opt_name'] );
$this->render_field_description(
sprintf(
__( 'Find the method name to use under Connections > [Connection Type] in your %s. ', 'wp-auth0' ),
$this->get_dashboard_link()
) .
__( 'Click the expand icon and use the value in the "Name" field (like "google-oauth2")', 'wp-auth0' )
__( 'Please see the "Universal Login Page" setting on the Features tab', 'wp-auth0' )
);
}

Expand Down
52 changes: 52 additions & 0 deletions lib/admin/WP_Auth0_Admin_Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public function init() {
'id' => 'wpa0_passwordless_enabled',
'function' => 'render_passwordless_enabled',
),
array(
'name' => __( 'Universal Login Page', 'wp-auth0' ),
'opt' => 'auto_login',
'id' => 'wpa0_auto_login',
'function' => 'render_auto_login',
),
array(
'name' => __( 'Auto Login Method', 'wp-auth0' ),
'opt' => 'auto_login_method',
'id' => 'wpa0_auto_login_method',
'function' => 'render_auto_login_method',
),
array(
'name' => __( 'Multifactor Authentication (MFA)', 'wp-auth0' ),
'opt' => 'mfa',
Expand Down Expand Up @@ -195,6 +207,46 @@ public function render_passwordless_enabled( $args = array() ) {
);
}

/**
* Render form field and description for the `auto_login` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*/
public function render_auto_login( $args = array() ) {
$this->render_switch( $args['label_for'], $args['opt_name'], 'wpa0_auto_login_method' );
$this->render_field_description(
__( 'Use the Universal Login Page (ULP) for authentication. ', 'wp-auth0' ) .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only place you use (ULP) (in this PR at least). not a deal breaker for me, your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luisrudge - Used on line 225 below as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn tunnel vision. I was looking in other code blocks 😬

__( 'When turned on, <code>wp-login.php</code> will be redirected to the hosted login page. ', 'wp-auth0' ) .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will redirect instead of will be redirected?

__( 'When turned off, <code>wp-login.php</code> will show an embedded login form. ', 'wp-auth0' ) .
$this->get_docs_link( 'guides/login/universal-vs-embedded', __( 'More on ULP vs embedded here', 'wp-auth0' ) )
);
}

/**
* Render form field and description for the `auto_login_method` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*/
public function render_auto_login_method( $args = array() ) {
$this->render_text_field( $args['label_for'], $args['opt_name'] );
$this->render_field_description(
__( 'Enter a name here to automatically use a single, specific connection to login . ', 'wp-auth0' ) .
sprintf(
__( 'Find the method name to use under Connections > [Connection Type] in your %s. ', 'wp-auth0' ),
$this->get_dashboard_link()
) .
__( 'Click the expand icon and use the value in the "Name" field (like "google-oauth2")', 'wp-auth0' )
);
}

/**
* Render form field and description for the `mfa` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
Expand Down