Skip to content

[12.x] Additional password reset token env vars #55408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

gsinti
Copy link

@gsinti gsinti commented Apr 14, 2025

This adds optional environment variables to config/auth.php for the passwords entry, allowing token expiration and reset request throttling to be configured without publishing the config file.

This adds optional environment variables to `config/auth.php` for the `passwords` entry, allowing token expiration and reset request throttling to be configured without publishing the config file.
@gsinti gsinti changed the title Additional password reset token env vars [12.x] Additional password reset token env vars Apr 14, 2025
@@ -94,8 +94,8 @@
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
'expire' => (int) env('AUTH_PASSWORD_RESET_TOKEN_EXPIRE', 60),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set or change these values through env variables?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason we allow the table to be set through an environment variable.

With Laravel 11.x, new projects don't start with the majority of config files published in order to reduce boilerplate.

This change allows the expiration and throttle to be configured without publishing the entire auth.php file or needing to add the passwords section at all (if already published).

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@gsinti
Copy link
Author

gsinti commented Apr 15, 2025

@taylorotwell: Thanks for your comment.

This is following the slim skeleton release introduced in #47309.

The default configuration files have also received many more environment variables so that more options can be changed from the application’s .env file.

If I want to change the throttle or expiry, I must now publish the entire config/auth.php to make this single change instead of overriding it with an environment variable.

Is that the intended process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants