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

[5.4] Do not touch the user timestamps when updating the remember_token. #17135

Merged
merged 2 commits into from
Jan 5, 2017
Merged

[5.4] Do not touch the user timestamps when updating the remember_token. #17135

merged 2 commits into from
Jan 5, 2017

Conversation

lucasmichot
Copy link
Contributor

@lucasmichot lucasmichot commented Jan 4, 2017

As discussed with @taylorotwell

It makes no sense to touch the updated_at field of the user when his remember_token is set or updated.

Note:


Also see #16660 (comment)

@lucasmichot lucasmichot changed the title [5.4] WIP - Do not touch the user timestamps when updating the remember_token. [5.4] Do not touch the user timestamps when updating the remember_token. Jan 4, 2017
@deefour
Copy link
Contributor

deefour commented Jan 4, 2017

$user = Auth::user();

Auth::logout();

$user->attribute = 'value';
$user->save();

Won't this prevent the explicit save above from causing updated_at to change too? Maybe restoring $timestamps from a temp variable after the save() in this PR would be better? Having the setting left as false seems an unexpected side-effect.

@lucasmichot
Copy link
Contributor Author

Very good input @deefour : see acebc5a

@taylorotwell taylorotwell merged commit acebc5a into laravel:5.4 Jan 5, 2017
@lucasmichot lucasmichot deleted the feature/5.4/remember-token branch January 10, 2017 07:38
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