Skip to content
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

[9.x] Add passwordTimeout to RequirePassword middleware as a parameter #35531

Merged
merged 2 commits into from
Dec 8, 2020
Merged

Conversation

AlinIonut
Copy link

@AlinIonut AlinIonut commented Dec 8, 2020

@driesvints as requested to master

This PR add the possibility to customize the RequirePassword middleware passwordTimeout duration, witch is retrieved from config default value at config('auth.password_timeout').

Example:

Route::get('/foo}', 'FooController@foo')->middleware(['password.confirm:password.confirm,60']);

'password.confirm' value parameter keeps the current possibility to customize desired redirect route.
'60' value parameter allow developers to customize passwordTimeout in seconds for each route as desired.

PS: This is my first PR to Laravel, soo please don't be to harsh, I'm learning to.
PS2: Initially I was thinking to preserve this logic with only one parameter (the current 'redirectToRoute') and check if is numeric, but I decided to keep it as simple as possible, and avoid conflicts with possible routes named as numeric.

@driesvints driesvints changed the title add passwordTimeout to RequirePassword middleware as a parameter [9.x] Add passwordTimeout to RequirePassword middleware as a parameter Dec 8, 2020
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.

2 participants