@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $user = User::where('username', '=', $loginParams['username'])->get()->first(); |
91 | 91 | |
92 | 92 | if (count($user) > 0) { |
93 | - $userInfo = ['id' => $user->id,]; |
|
93 | + $userInfo = ['id' => $user->id, ]; |
|
94 | 94 | |
95 | 95 | if (password_verify($loginParams['password'], $user->password)) { |
96 | 96 | $token = $this->buildAcessToken($userInfo); |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | * Create the token params as an array |
162 | 162 | */ |
163 | 163 | $data = [ |
164 | - 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
165 | - 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
166 | - 'iss' => $serverName, // Issuer |
|
167 | - 'nbf' => $notBefore, // Not before |
|
168 | - 'exp' => $expire, // Expire |
|
169 | - 'dat' => $userData, // User Information retrieved from the database |
|
164 | + 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
165 | + 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
166 | + 'iss' => $serverName, // Issuer |
|
167 | + 'nbf' => $notBefore, // Not before |
|
168 | + 'exp' => $expire, // Expire |
|
169 | + 'dat' => $userData, // User Information retrieved from the database |
|
170 | 170 | ]; |
171 | 171 | |
172 | 172 | $loadEnv = DatabaseConnection::loadEnv(); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $secretKey = base64_decode(getenv('secret')); |
175 | 175 | |
176 | 176 | $jwt = JWT::encode( |
177 | - $data, //Data to be encoded in the JWT |
|
177 | + $data, //Data to be encoded in the JWT |
|
178 | 178 | $secretKey, // The signing key |
179 | 179 | 'HS512' // Algorithm used to sign the token |
180 | 180 | ); |