gateway: move login/oauth endpoints under /api
In this way, when bundling the web interface inside the agola binaries, oauth2 redirect to the web interfaces will be served by the webbundle handler and return the web SPA and not resolve directly the /oauth2/callback api call.
This commit is contained in:
parent
b22c197fef
commit
30f398e361
|
@ -292,10 +292,10 @@ func (g *Gateway) Run(ctx context.Context) error {
|
|||
// TODO(sgotti) add auth to these requests
|
||||
router.Handle("/repos/{rest:.*}", reposHandler).Methods("GET", "POST")
|
||||
|
||||
router.Handle("/login", loginUserHandler).Methods("POST")
|
||||
router.Handle("/authorize", authorizeHandler).Methods("POST")
|
||||
router.Handle("/register", registerHandler).Methods("POST")
|
||||
router.Handle("/oauth2/callback", oauth2callbackHandler).Methods("GET")
|
||||
router.Handle("/api/login", loginUserHandler).Methods("POST")
|
||||
router.Handle("/api/authorize", authorizeHandler).Methods("POST")
|
||||
router.Handle("/api/register", registerHandler).Methods("POST")
|
||||
router.Handle("/api/oauth2/callback", oauth2callbackHandler).Methods("GET")
|
||||
|
||||
router.Handle("/webhooks", webhooksHandler).Methods("POST")
|
||||
router.PathPrefix("/").HandlerFunc(handlers.NewWebBundleHandlerFunc(g.c.APIExposedURL))
|
||||
|
|
Loading…
Reference in New Issue