From f11c3a879d5592f5cbb9901ad484273e10ef4cb5 Mon Sep 17 00:00:00 2001 From: Mahayoga Date: Thu, 21 May 2026 00:27:11 +0700 Subject: [PATCH] WIP: Auth page --- .../Auth/NewPasswordController.php | 15 +- .../Auth/PasswordResetLinkController.php | 15 +- .../views/auth/forgot-password.blade.php | 186 +++++++++++++-- resources/views/auth/login.blade.php | 10 +- resources/views/auth/reset-password.blade.php | 225 +++++++++++++++--- 5 files changed, 382 insertions(+), 69 deletions(-) diff --git a/app/Http/Controllers/Auth/NewPasswordController.php b/app/Http/Controllers/Auth/NewPasswordController.php index e8368bd..6b0ea95 100644 --- a/app/Http/Controllers/Auth/NewPasswordController.php +++ b/app/Http/Controllers/Auth/NewPasswordController.php @@ -28,7 +28,7 @@ public function create(Request $request): View * * @throws \Illuminate\Validation\ValidationException */ - public function store(Request $request): RedirectResponse + public function store(Request $request) { $request->validate([ 'token' => ['required'], @@ -51,12 +51,17 @@ function (User $user) use ($request) { } ); + return response()->json([ + 'status' => $status == Password::PASSWORD_RESET, + 'msg' => $status == Password::PASSWORD_RESET ? 'Password reset successful' : 'Password reset failed' + ]); + // If the password was successfully reset, we will redirect the user back to // the application's home authenticated view. If there is an error we can // redirect them back to where they came from with their error message. - return $status == Password::PASSWORD_RESET - ? redirect()->route('login')->with('status', __($status)) - : back()->withInput($request->only('email')) - ->withErrors(['email' => __($status)]); + // return $status == Password::PASSWORD_RESET + // ? redirect()->route('login')->with('status', __($status)) + // : back()->withInput($request->only('email')) + // ->withErrors(['email' => __($status)]); } } diff --git a/app/Http/Controllers/Auth/PasswordResetLinkController.php b/app/Http/Controllers/Auth/PasswordResetLinkController.php index bf1ebfa..5a7205c 100644 --- a/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ b/app/Http/Controllers/Auth/PasswordResetLinkController.php @@ -23,7 +23,7 @@ public function create(): View * * @throws \Illuminate\Validation\ValidationException */ - public function store(Request $request): RedirectResponse + public function store(Request $request) { $request->validate([ 'email' => ['required', 'email'], @@ -36,9 +36,14 @@ public function store(Request $request): RedirectResponse $request->only('email') ); - return $status == Password::RESET_LINK_SENT - ? back()->with('status', __($status)) - : back()->withInput($request->only('email')) - ->withErrors(['email' => __($status)]); + return response()->json([ + 'status' => $status == Password::RESET_LINK_SENT, + 'msg' => __($status) + ]); + + // return $status == Password::RESET_LINK_SENT + // ? back()->with('status', __($status)) + // : back()->withInput($request->only('email')) + // ->withErrors(['email' => __($status)]); } } diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index 3c70788..810eeeb 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -1,25 +1,169 @@ - -
- {{ __('Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.') }} + + + + + + Lupa Password | {{ env('APP_NAME') }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ - - - -
- @csrf - - -
- - - +
+
+
+ - -
- - {{ __('Email Password Reset Link') }} - +
+
+
+

Lupa Password

+
+
+

Lupa password Anda? Masukkan email Anda dan kami akan mengirimkan link untuk mereset password.

+
+
+ + +
+
+ +
+
- - + +
+
+
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index d3d7a3f..60653a7 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -3,7 +3,7 @@ - Login | Smart Anxiety + Login | {{ env('APP_NAME') }} @@ -50,7 +50,7 @@
@@ -67,7 +67,7 @@
-
Forgot Password?
+
Forgot Password?
@@ -81,8 +81,8 @@
diff --git a/resources/views/auth/reset-password.blade.php b/resources/views/auth/reset-password.blade.php index a6494cc..e856937 100644 --- a/resources/views/auth/reset-password.blade.php +++ b/resources/views/auth/reset-password.blade.php @@ -1,39 +1,198 @@ - -
- @csrf + + + - - + + Reset Password | {{ env('APP_NAME') }} + + + + + + + - -
- - - + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+
+
+ - - -
- - - +
+
+
+

Reset Password

+ {{-- Don't have an account? --}} +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ +
+
- - -
- - - - - + +
+
+
+ + + + + + + + + + + + + + -
- - {{ __('Reset Password') }} - -
- - + + + + + \ No newline at end of file