浏览代码

Update Page\Auth

Visman 4 年之前
父节点
当前提交
020b0f0ca0
共有 1 个文件被更改,包括 3 次插入9 次删除
  1. 3 9
      app/Models/Pages/Auth.php

+ 3 - 9
app/Models/Pages/Auth.php

@@ -362,7 +362,7 @@ class Auth extends Page
     {
         if (
             ! \hash_equals($args['hash'], $this->c->Secury->hash($args['id'] . $args['key']))
-            || ! ($user = $this->c->users->load((int) $args['id'])) instanceof User
+            || ! ($user = $this->c->users->load($args['id'])) instanceof User
             || ! \hash_equals($user->activate_string, $args['key'])
         ) {
             $this->c->Log->warning('Passphrase reset: confirmation, fail', [
@@ -453,15 +453,9 @@ class Auth extends Page
     protected function formChange(array $args): array
     {
         return [
-            'action' => $this->c->Router->link(
-                'ChangePassword',
-                $args
-            ),
+            'action' => $this->c->Router->link('ChangePassword', $args),
             'hidden' => [
-                'token' => $this->c->Csrf->create(
-                    'ChangePassword',
-                    $args
-                ),
+                'token' => $this->c->Csrf->create('ChangePassword', $args),
             ],
             'sets'   => [
                 'forget' => [