浏览代码

Merge pull request #462 from pixelfed/frontend-ui-refactor

Update AccountController, fix #456
daniel 6 年之前
父节点
当前提交
e16ab42682
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 4 1
      app/Http/Controllers/AccountController.php
  2. 3 1
      app/User.php

+ 4 - 1
app/Http/Controllers/AccountController.php

@@ -295,7 +295,10 @@ class AccountController extends Controller
         if(password_verify($password, $user->password) === true) {
             $request->session()->put('sudoMode', time());
             return redirect($next);
+        } else {
+            return redirect()
+                ->back()
+                ->withErrors(['password' => __('auth.failed')]);
         }
-        return redirect($next);
     }
 }

+ 3 - 1
app/User.php

@@ -33,7 +33,9 @@ class User extends Authenticatable
      * @var array
      */
     protected $hidden = [
-        'password', 'remember_token',
+        'email', 'password', 'is_admin', 'remember_token', 
+        'email_verified_at', '2fa_enabled', '2fa_secret', 
+        '2fa_backup_codes', '2fa_setup_at',
     ];
 
     public function profile()