Skip to content

Commit c8387bc

Browse files
authored
Merge pull request #184 from rtCamp/fix/login-issue-with-expired-cookie
Fix: Login issue - Need to click login with google button twice
2 parents d179ca4 + 5d415d7 commit c8387bc

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

.github/ci/main.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function create_and_configure_site () {
3434
ls
3535
wp plugin activate login-with-google --allow-root
3636
wp user create automation [email protected] --role=administrator --user_pass=automation --allow-root
37-
wp theme activate twentytwentyone --allow-root
3837
}
3938

4039

.github/workflows/e2e-test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# e2e test for Login with google plugin.
1+
# e2e test for Login with google plugin.
22

33
name: CI for Login with google plugin test
44

55
# Controls when the workflow will run
66
on:
77
# Triggers the workflow on push or pull request events but only for the main branch
8-
# push:
9-
# branches:
10-
# - develop
11-
# - master
12-
# pull_request:
13-
# branches:
14-
# - develop
15-
# - master
8+
# push:
9+
# branches:
10+
# - develop
11+
# - master
12+
# pull_request:
13+
# branches:
14+
# - develop
15+
# - master
1616

1717
# Allows you to run this workflow manually from the Actions tab
1818
workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
2222
# The type of runner that the job will run on
2323
name: Run Login with google plugin test Cases
2424
runs-on: ubuntu-latest
25-
env:
25+
env:
2626
GMAIL_UNAME: ${{ secrets.GMAIL_UNAME }}
2727
GMAIL_PASS: ${{ secrets.GMAIL_PASS }}
2828
TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }}

.github/workflows/phpcs_on_pull_request.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
on: pull_request
1+
on:
2+
workflow_dispatch:
23
name: Inspections
34
jobs:
45
runPHPCSInspection:

login-with-google.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ function container(): Container {
112112
function plugin(): Plugin {
113113
static $plugin;
114114

115+
$reauth = filter_input( INPUT_GET, 'reauth', FILTER_SANITIZE_STRING );
116+
if ( null !== $reauth ) {
117+
if ( ! empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
118+
wp_safe_redirect( wp_login_url() );
119+
exit;
120+
}
121+
}
122+
115123
if ( null !== $plugin ) {
116124
return $plugin;
117125
}

0 commit comments

Comments
 (0)