Skip to content

Commit 2169fcd

Browse files
committed
no message
1 parent 3250d24 commit 2169fcd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Auth.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ public static function validate_token( $token = null ) {
274274
/**
275275
* Decode the Token
276276
*/
277+
JWT::$leeway = 60;
277278
$token = ! empty( $token ) ? JWT::decode( $token, self::get_secret_key(), [ 'HS256' ] ) : null;
278279

279280
/**

tests/test-authentication.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function setUp() {
2222

2323
$this->admin = $this->factory->user->create( [
2424
'role' => 'administrator',
25-
'user_login' => 'testUser',
25+
'user_login' => 'testuser',
2626
'user_pass' => 'testPassword',
2727
] );
2828

@@ -67,7 +67,7 @@ public function testLoginWithBadCredentials() {
6767
*/
6868
$actual = do_graphql_request( $this->login_mutation, 'LoginUser', [
6969
'input' => [
70-
'username' => 'testUser',
70+
'username' => 'testuser',
7171
'password' => 'badPassword',
7272
'clientMutationId' => uniqid(),
7373
]
@@ -95,7 +95,7 @@ public function testLoginWithNoSecretKeyConfigured() {
9595
*/
9696
$actual = do_graphql_request( $this->login_mutation, 'LoginUser', [
9797
'input' => [
98-
'username' => 'testUser',
98+
'username' => 'testuser',
9999
'password' => 'testPassword',
100100
'clientMutationId' => uniqid(),
101101
]
@@ -140,7 +140,7 @@ public function testLoginWithPage() {
140140
*/
141141
$actual = do_graphql_request( $this->login_mutation, 'LoginUser', [
142142
'input' => [
143-
'username' => 'testUser',
143+
'username' => 'testuser',
144144
'password' => 'testPassword',
145145
'clientMutationId' => uniqid(),
146146
]
@@ -156,7 +156,7 @@ public function testLoginWithPage() {
156156
'login' => [
157157
'authToken' => $token,
158158
'user' => [
159-
'username' => 'testUser',
159+
'username' => 'testuser',
160160
'pages' => [
161161
'edges' => [
162162
[
@@ -190,7 +190,7 @@ public function testLoginWithValidUserThatWasJustDeleted() {
190190
*/
191191
$actual = do_graphql_request( $this->login_mutation, 'LoginUser', [
192192
'input' => [
193-
'username' => 'testUser',
193+
'username' => 'testuser',
194194
'password' => 'testPassword',
195195
'clientMutationId' => uniqid(),
196196
]

0 commit comments

Comments
 (0)