laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.93k stars 809 forks source link

confirmPassword-config currently broken #1463

Closed Suven closed 3 months ago

Suven commented 3 months ago

Jetstream Version

v5.0.1

Jetstream Stack

Livewire

Laravel Version

v11.1.1

PHP Version

8.3.0

Database Driver & Version

No response

Description

What I want to do

In my settings I want to turn off password-confirmations, as my users do not have passwords.

Desc

Fortify has a feature/config-flag to enable or disable password confirmations for certain actions:

https://github.com/laravel/fortify/blob/1.x/stubs/fortify.php#L154

It seems that this should, at least, toggle wether or not a password is required for activating/modifying 2FA:

https://github.com/laravel/fortify/blob/0c1721f0e50dd63fa3a4b4ad7ade553b821ec015/routes/routes.php#L139

On the PHP-side in Jetstream, that is also supported:

https://github.com/laravel/jetstream/blob/a57f6e9bc24a8befb74c5d668cd247ffe39bc40a/src/Http/Livewire/TwoFactorAuthenticationForm.php#L65

But it seems that the feature is hardcoded into the view and thus, setting it to false, has no effect.

https://github.com/laravel/jetstream/blob/5.x/stubs/livewire/resources/views/profile/two-factor-authentication-form.blade.php#L81

Steps To Reproduce

  1. Start a fresh project
  2. Install Jetstream with livewire
  3. Switch the setting https://github.com/Suven/jetstream-example/commit/2b5ac739ebade8352d33c2ab7826a309a50c10c9
  4. It does not take effect
github-actions[bot] commented 3 months ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Suven commented 3 months ago

Unfortunately Taylor closed the PR and thus I feel like this issue can also be closed as a consequence. I would still make the argument that, if that feature is not supported on purpose, then the other references to that in fortify and Jetstream should still be removed to prevent confusion

driesvints commented 3 months ago

@Suven I think it's best to just remove the code if you don't want the feature like Taylor suggested. People rely on the boolean checks in jetstream way too much rather than just updating the code since Jetstream is a scaffold.