Skip to content

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

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

unknwon merged 3 commits into
gogs:mainfrom
maishivamhoo123:feat/custom-logout-url

Conversation

@maishivamhoo123

@maishivamhoo123 maishivamhoo123 commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

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)

@unknwon unknwon left a comment

Copy link
Copy Markdown
Member

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.

Comment thread templates/admin/config.tmpl Resolved
@maishivamhoo123

Copy link
Copy Markdown
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
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