diff --git a/.github/ci/main.sh b/.github/ci/main.sh index 6f31120e..700187c2 100644 --- a/.github/ci/main.sh +++ b/.github/ci/main.sh @@ -34,7 +34,6 @@ function create_and_configure_site () { ls wp plugin activate login-with-google --allow-root wp user create automation automation@example.com --role=administrator --user_pass=automation --allow-root - wp theme activate twentytwentyone --allow-root } diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index d7c4b429..a9ff4342 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -1,18 +1,18 @@ -# e2e test for Login with google plugin. +# e2e test for Login with google plugin. name: CI for Login with google plugin test # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the main branch -# push: -# branches: -# - develop -# - master -# pull_request: -# branches: -# - develop -# - master + # push: + # branches: + # - develop + # - master + # pull_request: + # branches: + # - develop + # - master # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -22,7 +22,7 @@ jobs: # The type of runner that the job will run on name: Run Login with google plugin test Cases runs-on: ubuntu-latest - env: + env: GMAIL_UNAME: ${{ secrets.GMAIL_UNAME }} GMAIL_PASS: ${{ secrets.GMAIL_PASS }} TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }} diff --git a/.github/workflows/phpcs_on_pull_request.yml b/.github/workflows/phpcs_on_pull_request.yml index ba827aa1..da5af7b7 100644 --- a/.github/workflows/phpcs_on_pull_request.yml +++ b/.github/workflows/phpcs_on_pull_request.yml @@ -1,4 +1,5 @@ -on: pull_request +on: + workflow_dispatch: name: Inspections jobs: runPHPCSInspection: diff --git a/login-with-google.php b/login-with-google.php index 5fdd52c1..9d80d6b5 100644 --- a/login-with-google.php +++ b/login-with-google.php @@ -112,6 +112,14 @@ function container(): Container { function plugin(): Plugin { static $plugin; + $reauth = filter_input( INPUT_GET, 'reauth', FILTER_SANITIZE_STRING ); + if ( null !== $reauth ) { + if ( ! empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { + wp_safe_redirect( wp_login_url() ); + exit; + } + } + if ( null !== $plugin ) { return $plugin; }