Thanks to visit codestin.com
Credit goes to github.com

Skip to content

auth: support redirecting to custom URL upon sign out#8089

Merged
unknwon merged 3 commits intogogs:mainfrom
maishivamhoo123:feat/custom-logout-url
Jan 16, 2026
Merged

auth: support redirecting to custom URL upon sign out#8089
unknwon merged 3 commits intogogs:mainfrom
maishivamhoo123:feat/custom-logout-url

Conversation

@maishivamhoo123
Copy link
Contributor

@maishivamhoo123 maishivamhoo123 commented Jan 16, 2026

Describe the pull request

This PR adds support for a CUSTOM_LOGOUT_URL configuration under the [auth] section.

Problem: When Gogs is used behind a Reverse Proxy with SSO (like Authelia, Cloudflare Access, or Keycloak), clicking "Sign Out" only clears the Gogs session. The user remains logged into the SSO provider.

Solution: Administrators can now set CUSTOM_LOGOUT_URL to redirect users to the SSO provider's logout endpoint immediately after the Gogs session is destroyed.

Link to the issue: closes #8077

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan.

Test plan

  1. Add the following to custom/conf/app.ini:
    [auth]
    CUSTOM_LOGOUT_URL = [https://google.com](https://google.com)

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

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

Thank you! Just one minor issue.

@maishivamhoo123
Copy link
Contributor Author

@unknwon
Thank you for the review, sir. I’ve fixed the indentation issue, rebased the branch, and pushed the latest changes.

Kindly let me know if there’s anything else I should update. Thanks again!

@unknwon unknwon changed the title auth: add CUSTOM_LOGOUT_URL and cleanup formatting auth: support redirecting to custom URL upon sign out Jan 16, 2026
@unknwon unknwon merged commit b701008 into gogs:main Jan 16, 2026
12 checks 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.

Add option for custom logout url when using reverse proxy authentication

2 participants