From 0fed56e37a15f0100ca8d0a9a9d9fa806eb2d2c7 Mon Sep 17 00:00:00 2001 From: Graphictoria Date: Mon, 2 May 2022 22:59:29 -0400 Subject: [PATCH] Password reset views. --- .../Auth/NewPasswordController.php | 6 +- .../views/auth/forgot-password.blade.php | 71 ++++++++-------- .../views/auth/reset-password.blade.php | 81 +++++++++---------- 3 files changed, 76 insertions(+), 82 deletions(-) diff --git a/web/app/Http/Controllers/Auth/NewPasswordController.php b/web/app/Http/Controllers/Auth/NewPasswordController.php index 1df8e21..aae4c25 100644 --- a/web/app/Http/Controllers/Auth/NewPasswordController.php +++ b/web/app/Http/Controllers/Auth/NewPasswordController.php @@ -35,7 +35,6 @@ class NewPasswordController extends Controller { $request->validate([ 'token' => ['required'], - 'email' => ['required', 'email'], 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); @@ -43,7 +42,7 @@ class NewPasswordController extends Controller // will update the password on an actual user model and persist it to the // database. Otherwise we will parse the error and return the response. $status = Password::reset( - $request->only('email', 'password', 'password_confirmation', 'token'), + $request->only('password', 'password_confirmation', 'token'), function ($user) use ($request) { $user->forceFill([ 'password' => Hash::make($request->password), @@ -59,7 +58,6 @@ class NewPasswordController extends Controller // 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)]); + : back()->withErrors(['status' => __($status)]); } } diff --git a/web/resources/views/auth/forgot-password.blade.php b/web/resources/views/auth/forgot-password.blade.php index 0642fa8..b7e247d 100644 --- a/web/resources/views/auth/forgot-password.blade.php +++ b/web/resources/views/auth/forgot-password.blade.php @@ -1,36 +1,41 @@ - - - - - - - +@php + $fields = [ + 'email' => 'Email Address' + ]; +@endphp -
- {{ __('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.') }} -
+@extends('layouts.app') - - +@section('title', 'Forgot Password') - - - -
- @csrf - - -
- - - -
- -
- - {{ __('Email Password Reset Link') }} - -
-
-
-
+@section('content') +
+ + + FORGOT PASSWORD + + +
+ @if ($errors->any()) +
+
{{ $errors->first() }}
+
+ @endif + +
Forgot your password? No problem!
+

Enter the email address associated with your account and we'll send you a reset link.

+ +
+ @csrf + @foreach($fields as $field => $label) + ($errors->first($field) != null)]) placeholder="{{ $label }}" name="{{ $field }}" :value="old($field)" /> + @endforeach + Back  + +
+
+
+ +
+
+@endsection \ No newline at end of file diff --git a/web/resources/views/auth/reset-password.blade.php b/web/resources/views/auth/reset-password.blade.php index 979d1b4..49f5846 100644 --- a/web/resources/views/auth/reset-password.blade.php +++ b/web/resources/views/auth/reset-password.blade.php @@ -1,48 +1,39 @@ - - - - - - - +@php + $fields = [ + 'password' => 'New Password', + 'password_confirmation' => 'Confirm New Password' + ]; +@endphp - - +@extends('layouts.app') -
- @csrf +@section('title', 'Reset Password') - - - - -
- - - -
- - -
- - - -
- - -
- - - -
- -
- - {{ __('Reset Password') }} - -
-
-
-
+@section('content') +
+ + + RESET PASSWORD + + +
+ @if ($errors->any()) +
+
{{ $errors->first() }}
+
+ @endif + +
+ @csrf + + @foreach($fields as $field => $label) + ($errors->first($field) != null)]) placeholder="{{ $label }}" name="{{ $field }}" :value="old($field)" /> + @endforeach + +
+
+
+ +
+
+@endsection \ No newline at end of file