some fix
This commit is contained in:
		| @@ -35,17 +35,17 @@ class SecureRestController extends RestController | |||||||
|                         "iat" => time(), |                         "iat" => time(), | ||||||
|                         "exp" => date("Y-m-d H:i:s", strtotime("+30 days")) |                         "exp" => date("Y-m-d H:i:s", strtotime("+30 days")) | ||||||
|                     ], |                     ], | ||||||
|                     key: $model->{'password_hash'}, |                     key: $model->password_hash, | ||||||
|                     alg: 'HS256' |                     alg: 'HS256' | ||||||
|                 ); |                 ); | ||||||
|  |  | ||||||
|                 $model->{'access_token'} = $jwt; |                 $model->access_token = $jwt; | ||||||
|                 $model->{'access_token_expires_at'} = |                 $model->access_token_expires_at = | ||||||
|                     JWT::decode($jwt, new Key($model->{'password_hash'}, 'HS256'))->exp; |                     JWT::decode($jwt, new Key($model->password_hash, 'HS256'))->exp; | ||||||
|  |  | ||||||
|                 $res = [ |                 $res = [ | ||||||
|                     "access_token" => $model->{'access_token'}, |                     "access_token" => $model->access_token, | ||||||
|                     "access_token_expires_at" => $model->{'access_token_expires_at'}, |                     "access_token_expires_at" => $model->access_token_expires_at, | ||||||
|                 ]; |                 ]; | ||||||
|             } |             } | ||||||
|             $model->save(); |             $model->save(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user