laravel / jetstream

Tailwind scaffolding for the Laravel framework.

Home Page:https://jetstream.laravel.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

confirmPassword-config currently broken

Suven opened this issue · comments

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:

public function enableTwoFactorAuthentication(EnableTwoFactorAuthentication $enable)

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 Suven/jetstream-example@2b5ac73
  4. It does not take effect

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!

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

@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.