From 215d2b1290219335e81a3fcf9cda061fd1a21367 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Mon, 21 Oct 2024 15:56:51 +0300 Subject: [PATCH] some fix --- .../secure/controllers/SecureRestController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/modules/secure/controllers/SecureRestController.php b/kernel/modules/secure/controllers/SecureRestController.php index d9c6d60..0eec824 100644 --- a/kernel/modules/secure/controllers/SecureRestController.php +++ b/kernel/modules/secure/controllers/SecureRestController.php @@ -35,17 +35,17 @@ class SecureRestController extends RestController "iat" => time(), "exp" => date("Y-m-d H:i:s", strtotime("+30 days")) ], - key: $model->{'password_hash'}, + key: $model->password_hash, alg: 'HS256' ); - $model->{'access_token'} = $jwt; - $model->{'access_token_expires_at'} = - JWT::decode($jwt, new Key($model->{'password_hash'}, 'HS256'))->exp; + $model->access_token = $jwt; + $model->access_token_expires_at = + JWT::decode($jwt, new Key($model->password_hash, 'HS256'))->exp; $res = [ - "access_token" => $model->{'access_token'}, - "access_token_expires_at" => $model->{'access_token_expires_at'}, + "access_token" => $model->access_token, + "access_token_expires_at" => $model->access_token_expires_at, ]; } $model->save();