Mercurial > borealpoint
comparison app/Http/Controllers/Auth/ConfirmablePasswordController.php @ 0:9d7dcd54c677
Initial Commit and package setup
| author | luka |
|---|---|
| date | Sat, 23 Aug 2025 22:20:51 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9d7dcd54c677 |
|---|---|
| 1 <?php | |
| 2 | |
| 3 namespace App\Http\Controllers\Auth; | |
| 4 | |
| 5 use App\Http\Controllers\Controller; | |
| 6 use Illuminate\Http\RedirectResponse; | |
| 7 use Illuminate\Http\Request; | |
| 8 use Illuminate\Support\Facades\Auth; | |
| 9 use Illuminate\Validation\ValidationException; | |
| 10 use Illuminate\View\View; | |
| 11 | |
| 12 class ConfirmablePasswordController extends Controller | |
| 13 { | |
| 14 /** | |
| 15 * Show the confirm password view. | |
| 16 */ | |
| 17 public function show(): View | |
| 18 { | |
| 19 return view('auth.confirm-password'); | |
| 20 } | |
| 21 | |
| 22 /** | |
| 23 * Confirm the user's password. | |
| 24 */ | |
| 25 public function store(Request $request): RedirectResponse | |
| 26 { | |
| 27 if (! Auth::guard('web')->validate([ | |
| 28 'email' => $request->user()->email, | |
| 29 'password' => $request->password, | |
| 30 ])) { | |
| 31 throw ValidationException::withMessages([ | |
| 32 'password' => __('auth.password'), | |
| 33 ]); | |
| 34 } | |
| 35 | |
| 36 $request->session()->put('auth.password_confirmed_at', time()); | |
| 37 | |
| 38 return redirect()->intended(route('dashboard', absolute: false)); | |
| 39 } | |
| 40 } |
