Skip to content

[13.x] remember token is nullable - #62105

Merged
taylorotwell merged 2 commits into
laravel:13.xfrom
browner12:AB-nullable-remember-token
Oct 22, 2026
Merged

taylorotwell merged 2 commits into
laravel:13.xfrom
browner12:AB-nullable-remember-token

Conversation

@browner12

Copy link
Copy Markdown
Contributor

the remember token is nullable, so we should allow setting it to null.

it's just a docblock so there's not actual language enforcement, but static analysis can still complain about it.

https://github.com/laravel/framework/blob/13.x/src/Illuminate/Database/Schema/Blueprint.php#L1745

the remember token is nullable, so we should allow setting it to `null`.

it's just a docblock so there's not actual language enforcement, but static analysis can still complain about it.

https://github.com/laravel/framework/blob/13.x/src/Illuminate/Database/Schema/Blueprint.php#L1745
matches the changes I made in the `Authenticatable` trait
@crynobone

Copy link
Copy Markdown
Member

null remember_token and using remember me feature can let to huge security risk. I don't think we should encourage this.

@browner12

Copy link
Copy Markdown
Contributor Author

@crynobone can you explain why? I'm currently using them in my application, and basically every default Laravel application starts with Users with null remember_token fields.

If it truly is a security risk, should we consider updating the default migration?

@browner12

Copy link
Copy Markdown
Contributor Author

@crynobone do you have an explanation on the security risk, or anything I can read? I'm struggling to find any information about security risks with a nullable token.

@taylorotwell taylorotwell reopened this Oct 22, 2026
@taylorotwell
taylorotwell merged commit 5c0486f into laravel:13.x Oct 22, 2026
123 checks passed
binaryfire added a commit to hypervel/components-backup that referenced this pull request Oct 26, 2026
Apply laravel/framework#62105 (5c0486f5a5) and #61876 (df12f83ce8). The Authenticatable contract, trait and GenericUser now accept null when clearing a remember token. Update implementing fixtures and the authentication contract example to match. GenericUser returns null when its password attribute is absent, avoiding a warning during passwordless login.

Port the complete upstream passwordless-login regression and add token-clearing regressions for both user implementations. Both defects reproduce before correction. Formatting, full source and type analysis, the Auth suite and every affected Broadcasting, JWT, Sanctum and Telescope test file pass.
@browner12
browner12 deleted the AB-nullable-remember-token branch October 26, 2026 16:05
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