summaryrefslogtreecommitdiffstats
path: root/api/oauth.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-22 12:54:27 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-09-22 13:54:27 -0400
commitdcf9e96a0b16530549168a7891ed8242663b5f28 (patch)
tree344255f0abbe1bd207e2f2ab864d245e240f4eeb /api/oauth.go
parente0d5703f721aafef1b55747cd09629860e86bfb4 (diff)
downloadchat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.gz
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.bz2
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.zip
remove global refs from api/api4 (#7496)
Diffstat (limited to 'api/oauth.go')
-rw-r--r--api/oauth.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/api/oauth.go b/api/oauth.go
index 6297b998c..0a26a6f98 100644
--- a/api/oauth.go
+++ b/api/oauth.go
@@ -13,19 +13,19 @@ import (
"github.com/mattermost/mattermost-server/utils"
)
-func InitOAuth() {
+func (api *API) InitOAuth() {
l4g.Debug(utils.T("api.oauth.init.debug"))
- BaseRoutes.OAuth.Handle("/register", ApiUserRequired(registerOAuthApp)).Methods("POST")
- BaseRoutes.OAuth.Handle("/list", ApiUserRequired(getOAuthApps)).Methods("GET")
- BaseRoutes.OAuth.Handle("/app/{client_id}", ApiUserRequired(getOAuthAppInfo)).Methods("GET")
- BaseRoutes.OAuth.Handle("/allow", ApiUserRequired(allowOAuth)).Methods("GET")
- BaseRoutes.OAuth.Handle("/authorized", ApiUserRequired(getAuthorizedApps)).Methods("GET")
- BaseRoutes.OAuth.Handle("/delete", ApiUserRequired(deleteOAuthApp)).Methods("POST")
- BaseRoutes.OAuth.Handle("/{id:[A-Za-z0-9]+}/deauthorize", ApiUserRequired(deauthorizeOAuthApp)).Methods("POST")
- BaseRoutes.OAuth.Handle("/{id:[A-Za-z0-9]+}/regen_secret", ApiUserRequired(regenerateOAuthSecret)).Methods("POST")
- BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/login", AppHandlerIndependent(loginWithOAuth)).Methods("GET")
- BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/signup", AppHandlerIndependent(signupWithOAuth)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/register", api.ApiUserRequired(registerOAuthApp)).Methods("POST")
+ api.BaseRoutes.OAuth.Handle("/list", api.ApiUserRequired(getOAuthApps)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/app/{client_id}", api.ApiUserRequired(getOAuthAppInfo)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/allow", api.ApiUserRequired(allowOAuth)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/authorized", api.ApiUserRequired(getAuthorizedApps)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/delete", api.ApiUserRequired(deleteOAuthApp)).Methods("POST")
+ api.BaseRoutes.OAuth.Handle("/{id:[A-Za-z0-9]+}/deauthorize", api.ApiUserRequired(deauthorizeOAuthApp)).Methods("POST")
+ api.BaseRoutes.OAuth.Handle("/{id:[A-Za-z0-9]+}/regen_secret", api.ApiUserRequired(regenerateOAuthSecret)).Methods("POST")
+ api.BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/login", api.AppHandlerIndependent(loginWithOAuth)).Methods("GET")
+ api.BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/signup", api.AppHandlerIndependent(signupWithOAuth)).Methods("GET")
}
func registerOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {