3 namespace App\Http\Controllers\Auth;
5 use App\Http\Controllers\Controller;
6 use App\Providers\RouteServiceProvider;
7 use Illuminate\Http\Request;
8 use Illuminate\Support\Facades\Auth;
9 use Illuminate\Validation\ValidationException;
11 class ConfirmablePasswordController extends Controller
14 * Show the confirm password view.
16 * @return \Illuminate\View\View
18 public function show()
20 return view('auth.confirm-password');
24 * Confirm the user's password.
26 * @param \Illuminate\Http\Request $request
29 public function store(Request $request)
31 if (! Auth::guard('web')->validate([
32 'email' => $request->user()->email,
33 'password' => $request->password,
35 throw ValidationException::withMessages([
36 'password' => __('auth.password'),
40 $request->session()->put('auth.password_confirmed_at', time());
42 return redirect()->intended(RouteServiceProvider::HOME);