feat(auth): honour remember_me and token_expiration_minutes on issued tokens #170
All Vouch review confidence checks passed
Residual risk 0.41 = Change Risk (0.65) × (1 − Review Confidence (0.38)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.65 · 332 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 89% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.065
Real PR Conversation Timeline
1 comments
"Review active on #170"
general
weight: 0.35
coderabbitai[bot]
What
POST auth/loginaccepts an optional booleanremember_me(a non-boolean answers 422).truegives the issued token the newremember_me_expiration_minuteslifetime (MAGIC_STARTER_REMEMBER_ME_EXPIRATION, default null, which falls back totoken_expiration_minutes; a non-positive or empty value reads as unset). The 2FA challenge token carries the flag, soPOST auth/two-factor-challengeissues the token with the lifetime the sign-in asked for.token_expiration_minutes(MAGIC_STARTER_TOKEN_EXPIRATION) was documented as the token lifetime but nothing read it, so a host that set it got tokens that never expire. It now setsexpires_aton every token the package issues (login, registration, 2FA challenge, OTP, guest, social, handoff). Null or 0 keeps today's tokens without their own expiry;sanctum.expirationstill applies on top.Why
The Flutter starter's login screen has a "Remember me" checkbox that sent
remember_meand the backend ignored it, so the control did nothing (found by a fresh independent audit; Anilcan decided on 2026-11-15 to implement it now). Reading the code for it showed the deadtoken_expiration_minuteskey.Compatibility
Defaults stay null, so nothing changes for a host that configures neither key. A host app that overrides
createAuthTokenorsignInResponsein a controller subclass must add the new trailing optional$rememberparameter to keep PHP's signature compatibility.Testing
tests/Http/Controllers/AuthTokenLifetimeTest.php(13 tests against real Sanctum) plus one guest-claim test; the new tests failed before the code (checked by the author).vendor/bin/pint --testpassed; PHPStan level 6 clean.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Password sign-ins can include an optional
remember_mechoice. Remembered sign-ins and their completed two-factor challenges can use a separate configured token lifetime.Package-issued tokens support a configurable lifetime; an unset or non-positive lifetime leaves tokens without a package-level expiry. Sanctum expiration may still apply.
Documentation
* Updated authentication and configuration guidance to explain the remember-me option, accepted values, token lifetime settings, and fallback behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->