From 8de8a736a1ac47ad1ca7b40caffd29b9ecffcb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Sun, 3 Dec 2023 21:11:04 +0100 Subject: [PATCH] wip --- resources/views/auth/reset-password.blade.php | 61 +++++++++++++++++++ src/Http/Controllers/Auth/LoginController.php | 6 ++ .../Auth/ResetPasswordController.php | 2 +- 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/resources/views/auth/reset-password.blade.php b/resources/views/auth/reset-password.blade.php index e69de29bb..583fe57d0 100644 --- a/resources/views/auth/reset-password.blade.php +++ b/resources/views/auth/reset-password.blade.php @@ -0,0 +1,61 @@ +@extends('root::auth.layout') + +{{-- Title --}} +@section('title', __('Reset Password')) + +{{-- Content --}} +@section('content') +
+ @csrf + +
+
+ + $errors->has('email')]) + id="email" + type="email" + name="email" + required + value="{{ Request::old('email') }}" + > + @error('email') + {{ $message }} + @enderror +
+
+ + $errors->has('password')]) + id="password" + type="password" + name="password" + required + value="{{ Request::old('password') }}" + > + @error('password') + {{ $message }} + @enderror +
+
+ + $errors->has('password_confirmation')]) + id="password_confirmation" + type="password" + name="password_confirmation" + required + value="{{ Request::old('password_confirmation') }}" + > + @error('password_confirmation') + {{ $message }} + @enderror +
+
+ +
+
+
+@endsection diff --git a/src/Http/Controllers/Auth/LoginController.php b/src/Http/Controllers/Auth/LoginController.php index 2291cbe62..7fe12f792 100644 --- a/src/Http/Controllers/Auth/LoginController.php +++ b/src/Http/Controllers/Auth/LoginController.php @@ -3,10 +3,12 @@ namespace Cone\Root\Http\Controllers\Auth; use Cone\Root\Http\Controllers\Controller; +use Illuminate\Auth\Events\Login; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Response as ResponseFactory; use Illuminate\Support\Facades\URL; @@ -56,6 +58,10 @@ public function login(Request $request): RedirectResponse $request->session()->regenerate(); + Event::dispatch( + new Login(Auth::getDefaultDriver(), $request->user(), $request->filled('remember')) + ); + return Redirect::intended(URL::route('root.dashboard')); } diff --git a/src/Http/Controllers/Auth/ResetPasswordController.php b/src/Http/Controllers/Auth/ResetPasswordController.php index 67c3e2937..b6abdbb58 100644 --- a/src/Http/Controllers/Auth/ResetPasswordController.php +++ b/src/Http/Controllers/Auth/ResetPasswordController.php @@ -47,7 +47,7 @@ function (User $user, string $password): void { ); return $response == Password::PASSWORD_RESET - ? Redirect::route('root.dashboard')->with('message', __($response)) + ? Redirect::route('root.dashboard')->with('status', __($response)) : Redirect::back()->withInput($request->only(['email']))->withErrors(['email' => __($response)]); }