Skip to content

Call logout endpoint#186

Merged
kasemj merged 1 commit into
mainfrom
logout
Dec 12, 2025
Merged

Call logout endpoint#186
kasemj merged 1 commit into
mainfrom
logout

Conversation

@kasemj

@kasemj kasemj commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

Call the logout endpoint (/api/user/login) when the logout method is invoked. This replaces the previous behavior of only clearing the local session token. Any errors during the API call are caught and logged.


Summary by cubic

Logout now calls the backend endpoint (/api/user/login) to invalidate the server session instead of only clearing the local token. Errors from the request are caught and logged, and the local session is still cleared.

Written for commit 8c8db96. Summary will update automatically on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Logout functionality now properly communicates with the server to end user sessions, with improved error handling for both successful and failed requests.

✏️ Tip: You can customize this high-level summary in your review settings.

Call the logout endpoint (`/api/user/login`) when the `logout` method is invoked. This replaces the previous behavior of only clearing the local session token. Any errors during the API call are caught and logged.
@coderabbitai

coderabbitai Bot commented Dec 12, 2025

Copy link
Copy Markdown

Walkthrough

Version 3.4.2 is documented in the changelog. The platform client's logout method is updated to perform an actual HTTP DELETE request to the logout endpoint instead of using a placeholder implementation, with error handling and logging included.

Changes

Cohort / File(s) Summary
Documentation Update
CHANGELOG.md
Adds new changelog entry for version 3.4.2 (2025-12-12) documenting the logout API call feature
Logout API Implementation
lib/src/platform_client.dart
Replaces placeholder logout logic with real HTTP DELETE call to /api/user/login, adds try/catch error handling with response logging on success and warning logging on failure, preserves session nullification after API call attempt

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the HTTP DELETE endpoint path (/api/user/login) is correct for the backend
  • Confirm error handling appropriateness (warning vs. exception) for logout failures
  • Check that session nullification occurs regardless of API success/failure

Poem

🐰 Logout calls now flow with grace,
No more stubs in this place!
A DELETE hops to the API shore,
Sessions cleared, we're out the door. 🚪✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Call logout endpoint' directly and accurately summarizes the main change: implementing an actual API call to the logout endpoint instead of just clearing local state.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch logout

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3ffafa and 8c8db96.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • lib/src/platform_client.dart (1 hunks)
🔇 Additional comments (2)
CHANGELOG.md (1)

7-10: LGTM!

The changelog entry accurately documents the logout API implementation. The version increment and date are appropriate.

lib/src/platform_client.dart (1)

227-235: Approve the fail-open logout implementation.

The logout method now calls the API endpoint using a standard REST pattern: DELETE /api/user/login mirrors the login endpoint (POST /api/user/login), which is a conventional and correct design. The implementation uses fail-open behavior (session is nullified even if the API call fails), which is reasonable for UX—it prevents users from being stuck in a logged-in state due to network issues.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

@kasemj kasemj merged commit 95fb90d into main Dec 12, 2025
3 checks passed
@kasemj kasemj deleted the logout branch December 12, 2025 18:49
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