Skip to content

Commit 39f5dee

Browse files
committed
added other indexes to the jwt
1 parent d4850ea commit 39f5dee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

public/login.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@
4747
* Create the token as an array
4848
*/
4949
$data = [
50-
'id' => $rs['id'], //userid from the users table
51-
'iat' => time(), //Issued at: time when the token was generated
52-
'jti' => uniqid(), //Json Token Id: an unique identifier for the token
50+
'id' => $rs['id'], //userid from the users table
51+
'iat' => time(), //Issued at: time when the token was generated
52+
'jti' => uniqid(), //Json Token Id: an unique identifier for the token
53+
'iss' => $_SERVER['SERVER_NAME'], //Issuer
54+
'nbf' => time(), //Not before
55+
'exp' => time() + 3600, //Expire
5356
];
5457

5558
/*

0 commit comments

Comments
 (0)