From 4cbde7bb0d3b19bf57f5ee39d9244645fc873316 Mon Sep 17 00:00:00 2001 From: Chaim Lev Ari Date: Wed, 16 Jan 2019 17:24:58 +0200 Subject: [PATCH] refactor(auth): move oauth handler under auth --- api/http/handler/auth/handler.go | 5 +++-- app/extensions/oauth/__module.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/http/handler/auth/handler.go b/api/http/handler/auth/handler.go index 073da3a69..a97928150 100644 --- a/api/http/handler/auth/handler.go +++ b/api/http/handler/auth/handler.go @@ -37,10 +37,11 @@ func NewHandler(bouncer *security.RequestBouncer, rateLimiter *security.RateLimi Router: mux.NewRouter(), authDisabled: authDisabled, } + + h.Handle("/auth/oauth", + rateLimiter.LimitAccess(bouncer.PublicAccess(httperror.LoggerHandler(h.authenticateOAuth)))).Methods(http.MethodPost) h.Handle("/auth", rateLimiter.LimitAccess(bouncer.PublicAccess(httperror.LoggerHandler(h.authenticate)))).Methods(http.MethodPost) - h.Handle("/oauth", - rateLimiter.LimitAccess(bouncer.PublicAccess(httperror.LoggerHandler(h.authenticateOAuth)))).Methods(http.MethodPost) return h } diff --git a/app/extensions/oauth/__module.js b/app/extensions/oauth/__module.js index 413d9d4f6..8292353a5 100644 --- a/app/extensions/oauth/__module.js +++ b/app/extensions/oauth/__module.js @@ -1,2 +1,2 @@ angular.module('portainer.extensions.oauth', ['ngResource']) - .constant('API_ENDPOINT_OAUTH', 'api/oauth'); + .constant('API_ENDPOINT_OAUTH', 'api/auth/oauth');