Skip to content

fix: emit the recycled remember-me token with authentication_succeeded - #272

Merged
Julien-R44 merged 1 commit into
adonisjs:10.xfrom
0xmamoud:fix/remember-me-recycled-token-event
Nov 5, 2026
Merged

Julien-R44 merged 1 commit into
adonisjs:10.xfrom
0xmamoud:fix/remember-me-recycled-token-event

Conversation

@0xmamoud

@0xmamoud 0xmamoud commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Fixes #271

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

authentication_succeeded now receives recycledToken instead of the token deleted by recycleRememberToken. The recycle token after use test asserts the emitted token.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed remember-me authentication so successful sign-in records and reports the current token after it is recycled, rather than the previously verified token. This keeps the authentication result and event details consistent with the token used for the ongoing session.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Remember-cookie authentication now reports the recycled remember-me token in the authentication-succeeded event. The token-recycling test checks that the event includes the replacement token’s identifier.

Changes: Remember-me authentication

Layer / File(s) Summary
Report the recycled token
modules/session_guard/guard.ts, tests/session/guard/authenticate.spec.ts
The session guard passes the recycled token to the success handler. The token-recycling test checks that the event includes the replacement token’s identifier.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to ca2c2

The authentication-success event now receives the replacement remember-me token, with a regression test checking its identifier. No merge-blocking issue remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the change to emit the recycled remember-me token in authentication_succeeded.
Linked Issues check Passed [#271] The session guard now emits the recycled remember-me token after cookie authentication. The token-recycling test asserts the emitted token identifier.
Out of Scope Changes check Passed [#271] The guard change fixes the reported event payload. The test change checks that fix. Both changes are within scope.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

modules/session_guard/guard.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

tests/session/guard/authenticate.spec.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d990aaa-e479-404b-bc7e-4acd1b8bdfb7
Commits

Reviewing files that changed from the base of the PR and between 356aede and ca2c2db.

Files selected for processing: 2

  • modules/session_guard/guard.ts
  • tests/session/guard/authenticate.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T22:22:53.697390Z ca2c2db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Julien-R44
Julien-R44 merged commit 0cf5576 into adonisjs:10.x Nov 5, 2026
1 check passed
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.

authentication_succeeded emits the deleted remember-me token

3 participants