@@ -268,12 +268,12 @@ discard block |
||
| 268 | 268 | $tokenExpire = time() + $expire; |
| 269 | 269 | $refreshTokenExpire = time() + $refreshExpire; |
| 270 | 270 | $this->jwt->setSecret($secret) |
| 271 | - ->setPayload([ |
|
| 272 | - 'sub' => $user->id, |
|
| 273 | - 'exp' => $tokenExpire, |
|
| 274 | - 'roles' => $roleIds, |
|
| 275 | - ]) |
|
| 276 | - ->sign(); |
|
| 271 | + ->setPayload([ |
|
| 272 | + 'sub' => $user->id, |
|
| 273 | + 'exp' => $tokenExpire, |
|
| 274 | + 'roles' => $roleIds, |
|
| 275 | + ]) |
|
| 276 | + ->sign(); |
|
| 277 | 277 | |
| 278 | 278 | $refreshToken = Str::random(128); |
| 279 | 279 | $jwtToken = $this->jwt->getToken(); |
@@ -286,17 +286,17 @@ discard block |
||
| 286 | 286 | $this->tokenRepository->save($token); |
| 287 | 287 | |
| 288 | 288 | $data = [ |
| 289 | - 'user' => [ |
|
| 289 | + 'user' => [ |
|
| 290 | 290 | 'id' => $user->id, |
| 291 | 291 | 'username' => $user->username, |
| 292 | 292 | 'lastname' => $user->lastname, |
| 293 | 293 | 'firstname' => $user->firstname, |
| 294 | 294 | 'email' => $user->email, |
| 295 | 295 | 'status' => $user->status, |
| 296 | - ], |
|
| 297 | - 'permissions' => $permissions, |
|
| 298 | - 'token' => $jwtToken, |
|
| 299 | - 'refresh_token' => $refreshToken, |
|
| 296 | + ], |
|
| 297 | + 'permissions' => $permissions, |
|
| 298 | + 'token' => $jwtToken, |
|
| 299 | + 'refresh_token' => $refreshToken, |
|
| 300 | 300 | ]; |
| 301 | 301 | |
| 302 | 302 | return array_merge($data, $this->getUserData($user, $token)); |
@@ -53,6 +53,5 @@ |
||
| 53 | 53 | * @class PermissionCacheInterface |
| 54 | 54 | * @package Platine\Framework\Auth\Authorization |
| 55 | 55 | */ |
| 56 | -interface PermissionCacheInterface extends StorageInterface |
|
| 57 | -{ |
|
| 56 | +interface PermissionCacheInterface extends StorageInterface { |
|
| 58 | 57 | } |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * @class NullCacheStorage |
| 41 | 41 | * @package Platine\Framework\Auth\Authorization\Cache |
| 42 | 42 | */ |
| 43 | -class NullCacheStorage extends NullStorage implements PermissionCacheInterface |
|
| 44 | -{ |
|
| 43 | +class NullCacheStorage extends NullStorage implements PermissionCacheInterface { |
|
| 45 | 44 | } |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * @class FileCacheStorage |
| 41 | 41 | * @package Platine\Framework\Auth\Authorization\Cache |
| 42 | 42 | */ |
| 43 | -class FileCacheStorage extends LocalStorage implements PermissionCacheInterface |
|
| 44 | -{ |
|
| 43 | +class FileCacheStorage extends LocalStorage implements PermissionCacheInterface { |
|
| 45 | 44 | } |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * @class ApcuCacheStorage |
| 41 | 41 | * @package Platine\Framework\Auth\Authorization\Cache |
| 42 | 42 | */ |
| 43 | -class ApcuCacheStorage extends ApcuStorage implements PermissionCacheInterface |
|
| 44 | -{ |
|
| 43 | +class ApcuCacheStorage extends ApcuStorage implements PermissionCacheInterface { |
|
| 45 | 44 | } |