Skip to content

Commit

Permalink
Removed backend needs for password_confirmation, bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee0z committed Nov 8, 2023
1 parent 64c82bb commit 330b6c8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/Exceptions/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ExceptionHandler extends Handler
protected $dontFlash = [
"current_password",
"password",
"password_confirmation",
];

public function register(): void
Expand Down
1 change: 0 additions & 1 deletion app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ class TrimStrings extends Middleware
protected $except = [
"current_password",
"password",
"password_confirmation",
];
}
2 changes: 1 addition & 1 deletion app/Http/Requests/RegisterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function rules(): array
return [
"name" => ["required", "string", "max:60"],
"email" => ["required", "string", "email", "max:255", "unique:users"],
"password" => ["required", Password::defaults(), "confirmed"],
"password" => ["required", Password::defaults()],
];
}
}
4 changes: 2 additions & 2 deletions resources/js/Shared/Layout/Nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ defineExpose({
<button type="button" class="absolute bottom-3 right-2 md:bottom-2" @click="togglePasswordVisibility">
<component :is="!isPasswordVisible ? EyeIcon : EyeSlashIcon" class="h-6 w-6 text-blumilk-400" />
</button>
<ErrorMessage :message="loginForm.errors.loginError" />
</div>
<ErrorMessage :message="loginForm.errors.loginError" />
<div class="flex w-full md:w-fit">
<button type="submit"
class="w-full rounded-lg bg-blumilk-500 p-4 font-semibold text-white hover:bg-blumilk-600 md:py-2"
Expand Down Expand Up @@ -220,8 +220,8 @@ defineExpose({
<button type="button" class="absolute bottom-3 right-2 md:bottom-2" @click="togglePasswordVisibility">
<component :is="!isPasswordVisible ? EyeIcon : EyeSlashIcon" class="h-6 w-6 text-blumilk-400" />
</button>
<ErrorMessage :message="registerForm.errors.password" />
</div>
<ErrorMessage :message="registerForm.errors.password" />
<div class="flex w-full md:w-fit">
<button type="submit"
class="w-full rounded-lg bg-blumilk-500 p-4 font-semibold text-white hover:bg-blumilk-600 md:py-2"
Expand Down
2 changes: 0 additions & 2 deletions tests/Feature/SignupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function testUserCanSignupWithProperCredentials(): void
"name" => "Test",
"email" => "[email protected]",
"password" => "123456789",
"password_confirmation" => "123456789",
];

$this->post(uri: "/register", data: $user);
Expand All @@ -29,7 +28,6 @@ public function testUserCannotBeCreatedWithInvalidName(): void
"name" => Str::random(256),
"email" => "[email protected]",
"password" => "123456789",
"password_confirmation" => "123456789",
]);

$response->assertSessionHasErrors(["name"]);
Expand Down

0 comments on commit 330b6c8

Please sign in to comment.