mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 01:36:43 +00:00
Update AccountController
This commit is contained in:
parent
ea88fd60b3
commit
336deae05b
1 changed files with 19 additions and 0 deletions
|
@ -278,4 +278,23 @@ class AccountController extends Controller
|
||||||
|
|
||||||
return response()->json(['msg' => 'success'], 200);
|
return response()->json(['msg' => 'success'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sudoMode(Request $request)
|
||||||
|
{
|
||||||
|
return view('auth.sudo');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sudoModeVerify(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate($request, [
|
||||||
|
'password' => 'required|string|max:500'
|
||||||
|
]);
|
||||||
|
$user = Auth::user();
|
||||||
|
$password = $request->input('password');
|
||||||
|
$next = $request->cookie('redirectNext') ?:'/';
|
||||||
|
if(password_verify($password, $user->password) === true) {
|
||||||
|
return redirect($next)->withCookie('sudoMode', time());
|
||||||
|
}
|
||||||
|
return redirect($next);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue