Skip to content

fix: ouath2proxy logout fix#5522

Merged
shahargl merged 2 commits intokeephq:mainfrom
piekarski-mateusz:fix/ouath2proxy-logout-fix
Jan 27, 2026
Merged

fix: ouath2proxy logout fix#5522
shahargl merged 2 commits intokeephq:mainfrom
piekarski-mateusz:fix/ouath2proxy-logout-fix

Conversation

@piekarski-mateusz
Copy link
Contributor

@piekarski-mateusz piekarski-mateusz commented Jan 26, 2026

Closes #5524

📑 Description

When using OAUTH2PROXY authentication (oauth2-proxy + FusionAuth), clicking "Sign Out" in the UI would immediately log the user back in. This happened because:

  1. NextAuth's signOut() only clears the local session cookie
  2. The oauth2-proxy session cookie remains active
  3. The FusionAuth session remains active

Since oauth2-proxy still has a valid session, it automatically re-authenticates the user on the next request.

  • shared/lib/hooks/useSignOut.ts - Check for OAUTH2PROXY auth type and redirect to /oauth2/sign_out
  • shared/api/ApiClient.ts - Same handling for automatic sign-out on 401 responses
  • Added unit tests for useSignOut hook (8 tests)
  • Added unit tests for ApiClient (6 tests)

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@vercel
Copy link

vercel bot commented Jan 26, 2026

@piekarski-mateusz is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 26, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 26, 2026

Target branch is not in the allowed branches list.

@dosubot dosubot bot added the Bug Something isn't working label Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.54%. Comparing base (97c263a) to head (7e8f826).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5522       +/-   ##
===========================================
- Coverage   46.39%   30.54%   -15.86%     
===========================================
  Files         176      101       -75     
  Lines       18412    11669     -6743     
===========================================
- Hits         8543     3564     -4979     
+ Misses       9869     8105     -1764     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 27, 2026
@shahargl shahargl enabled auto-merge (squash) January 27, 2026 08:19
@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
keep Ready Ready Preview, Comment Jan 27, 2026 8:33am

Request Review

@shahargl shahargl merged commit bf1293d into keephq:main Jan 27, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: oauth2proxy logout

2 participants