Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix post passwords getting redirected #698

Merged
merged 3 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ commands:
sudo docker-php-ext-install mysqli
sudo apt-get update
sudo composer self-update
sudo apt-get install -y subversion mysql-client
sudo apt-get install -y subversion default-mysql-client
- restore_cache:
keys:
- composer-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "composer.json" }}
Expand Down Expand Up @@ -49,9 +49,6 @@ commands:
dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
- run: composer test-ci
- run:
command: bash <(curl -s https://codecov.io/bash)
when: on_success

jobs:
php_5:
Expand All @@ -74,6 +71,9 @@ jobs:
- prepare
- run-tests
- run-formatting
- run:
command: bash <(curl -s https://codecov.io/bash)
when: on_success
snyk:
docker:
- image: snyk/snyk-cli:composer
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function wp_auth0_can_show_wp_login_form() {
return true;
}

if ( wp_auth0_is_current_login_action( array( 'resetpass', 'rp', 'validate_2fa' ) ) ) {
if ( wp_auth0_is_current_login_action( array( 'resetpass', 'rp', 'validate_2fa', 'postpass' ) ) ) {
return true;
}

Expand Down
8 changes: 8 additions & 0 deletions tests/testFunctionCanShowWpLoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public function testThatWpLoginCanBeShownIfOn2faPage() {
$this->assertTrue( wp_auth0_can_show_wp_login_form() );
}

public function testThatWpLoginCanBeShownIfProcessingPostPassword() {
self::auth0Ready();
$GLOBALS['pagenow'] = 'wp-login.php';
$_REQUEST['action'] = 'postpass';
self::$opts->set( 'wordpress_login_enabled', 'link' );
$this->assertTrue( wp_auth0_can_show_wp_login_form() );
}

public function testThatWpLoginCannotBeShownIfNotWle() {
self::auth0Ready();
self::$opts->set( 'wordpress_login_enabled', 'link' );
Expand Down