summaryrefslogtreecommitdiffstats
path: root/routers/routes/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/routes/routes.go')
-rw-r--r--routers/routes/routes.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index b73b030a51..01da321e49 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -257,6 +257,14 @@ func RegisterRoutes(m *macaron.Macaron) {
})
}, reqSignOut)
+ m.Group("/login/oauth", func() {
+ m.Get("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth)
+ m.Post("/grant", bindIgnErr(auth.GrantApplicationForm{}), user.GrantApplicationOAuth)
+ // TODO manage redirection
+ m.Post("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth)
+ }, ignSignInAndCsrf, reqSignIn)
+ m.Post("/login/oauth/access_token", bindIgnErr(auth.AccessTokenForm{}), ignSignInAndCsrf, user.AccessTokenOAuth)
+
m.Group("/user/settings", func() {
m.Get("", userSetting.Profile)
m.Post("", bindIgnErr(auth.UpdateProfileForm{}), userSetting.ProfilePost)
@@ -291,6 +299,12 @@ func RegisterRoutes(m *macaron.Macaron) {
}, openIDSignInEnabled)
m.Post("/account_link", userSetting.DeleteAccountLink)
})
+ m.Group("/applications/oauth2", func() {
+ m.Get("/:id", userSetting.OAuth2ApplicationShow)
+ m.Post("/:id", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsEdit)
+ m.Post("", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsPost)
+ m.Post("/delete", userSetting.DeleteOAuth2Application)
+ })
m.Combo("/applications").Get(userSetting.Applications).
Post(bindIgnErr(auth.NewAccessTokenForm{}), userSetting.ApplicationsPost)
m.Post("/applications/delete", userSetting.DeleteApplication)