@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | { |
41 | 41 | $tokenId = base64_encode(openssl_random_pseudo_bytes(32)); |
42 | 42 | $issuedAt = time(); |
43 | - $notBefore = $issuedAt + $secondsNotBefore; //Adding 10 seconds |
|
44 | - $expire = $notBefore + $secondsExpire; // Adding 60 seconds |
|
45 | - $serverName = $this->serverName; // Retrieve the server name from config file |
|
43 | + $notBefore = $issuedAt + $secondsNotBefore; //Adding 10 seconds |
|
44 | + $expire = $notBefore + $secondsExpire; // Adding 60 seconds |
|
45 | + $serverName = $this->serverName; // Retrieve the server name from config file |
|
46 | 46 | |
47 | 47 | /* |
48 | 48 | * Create the token as an array |
49 | 49 | */ |
50 | 50 | return [ |
51 | - 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
52 | - 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
53 | - 'iss' => $serverName, // Issuer |
|
54 | - 'nbf' => $notBefore, // Not before |
|
55 | - 'exp' => $expire, // Expire |
|
51 | + 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
52 | + 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
53 | + 'iss' => $serverName, // Issuer |
|
54 | + 'nbf' => $notBefore, // Not before |
|
55 | + 'exp' => $expire, // Expire |
|
56 | 56 | 'data' => $data // Data related to the signer user |
57 | 57 | ]; |
58 | 58 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * The output string can be validated at http://jwt.io/ |
67 | 67 | */ |
68 | 68 | $jwt = JWT::encode( |
69 | - $jwtData, //Data to be encoded in the JWT |
|
69 | + $jwtData, //Data to be encoded in the JWT |
|
70 | 70 | $this->jwtKey->getPrivateKey(), // The signing key |
71 | 71 | $this->jwtKey->getAlghoritm() |
72 | 72 | ); |