OAuth POST routes not using base path #4099

Closed
opened 2025-11-02 05:37:49 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @h3kker on GitHub (Oct 11, 2019).

  • Gitea version (or commit ref): 1.9.4
  • Git version: 2.22.0
  • Operating system: alpine 3.10.2
  • Database (use [x]):
    • [ x] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [x ] Not relevant
  • Log gist:

Description

We have a gitea installation (docker) behind a reverse proxy, accessible under a subpath, like https://example.com/repo/ (setting ROOT_URL = https://example.com/repo/)

This works well, but recently I tried to use an OAuth application (drone). I get the redirect to the gitea server to https://example.com/repo/login/oauth/authorize, but when I do click the "Authorize Application" button, the POST request goes to the base URL (without /repo) instead: https://example.com/login/oauth/authorize.

The same thing happens in the settings on the configuration page https://example.com/repo/user/settings/applications/oauth2/1
Clicking on the Save button sends the POST request to http://example.com/user/settings/applications/oauth2/1

I could not see any configuration settings (besides ROOT_URL) where I could set this up, but maybe I've missed something - in that case I'm sorry (and grateful for a pointer).

Thanks,
Heinz

Originally created by @h3kker on GitHub (Oct 11, 2019). - Gitea version (or commit ref): 1.9.4 - Git version: 2.22.0 - Operating system: alpine 3.10.2 - Database (use `[x]`): - [ x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x ] Not relevant - Log gist: ## Description We have a gitea installation (docker) behind a reverse proxy, accessible under a subpath, like https://example.com/repo/ (setting `ROOT_URL = https://example.com/repo/`) This works well, but recently I tried to use an OAuth application (drone). I get the redirect to the gitea server to https://example.com/repo/login/oauth/authorize, but when I do click the "Authorize Application" button, the POST request goes to the base URL (without /repo) instead: https://example.com/login/oauth/authorize. The same thing happens in the settings on the configuration page https://example.com/repo/user/settings/applications/oauth2/1 Clicking on the Save button sends the POST request to http://example.com/user/settings/applications/oauth2/1 I could not see any configuration settings (besides ROOT_URL) where I could set this up, but maybe I've missed something - in that case I'm sorry (and grateful for a pointer). Thanks, Heinz
Author
Owner

@h3kker commented on GitHub (Oct 15, 2019):

sorry, duplicate of #8461 opened just hours before I did...

@h3kker commented on GitHub (Oct 15, 2019): sorry, duplicate of #8461 opened just hours before I did...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4099