fix: lowercase email in forgot password

This commit is contained in:
Andras Bacsai 2023-09-13 20:27:58 +02:00
parent 23b7fc3c54
commit b22fecb615
2 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,7 @@
@if (is_transactional_emails_active()) @if (is_transactional_emails_active())
<form action="/forgot-password" method="POST" class="flex flex-col gap-2"> <form action="/forgot-password" method="POST" class="flex flex-col gap-2">
@csrf @csrf
<x-forms.input required value="test@example.com" type="email" name="email" <x-forms.input required type="email" name="email"
label="{{ __('input.email') }}" autofocus /> label="{{ __('input.email') }}" autofocus />
<x-forms.button type="submit">{{ __('auth.forgot_password_send_email') }}</x-forms.button> <x-forms.button type="submit">{{ __('auth.forgot_password_send_email') }}</x-forms.button>
</form> </form>

View File

@ -30,6 +30,10 @@ use Laravel\Fortify\Fortify;
Route::post('/forgot-password', function (Request $request) { Route::post('/forgot-password', function (Request $request) {
if (is_transactional_emails_active()) { if (is_transactional_emails_active()) {
$arrayOfRequest = $request->only(Fortify::email());
$request->merge([
'email' => Str::lower($arrayOfRequest['email']),
]);
$type = set_transanctional_email_settings(); $type = set_transanctional_email_settings();
if (!$type) { if (!$type) {
return response()->json(['message' => 'Transactional emails are not active'], 400); return response()->json(['message' => 'Transactional emails are not active'], 400);