Update oauth logout to include basepath
parent
2355c395b4
commit
d6d7081b1e
|
@ -217,7 +217,10 @@ func Test_Service_DashboardCells(t *testing.T) {
|
|||
ctx := context.Background()
|
||||
params := httprouter.Params{}
|
||||
for k, v := range test.ctxParams {
|
||||
params = append(params, httprouter.Param{k, v})
|
||||
params = append(params, httprouter.Param{
|
||||
Key: k,
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
ctx = httprouter.WithParams(ctx, params)
|
||||
|
||||
|
|
|
@ -213,12 +213,12 @@ func Test_KapacitorRulesGet(t *testing.T) {
|
|||
bg := context.Background()
|
||||
params := httprouter.Params{
|
||||
{
|
||||
"id",
|
||||
"1",
|
||||
Key: "id",
|
||||
Value: "1",
|
||||
},
|
||||
{
|
||||
"kid",
|
||||
"1",
|
||||
Key: "kid",
|
||||
Value: "1",
|
||||
},
|
||||
}
|
||||
ctx := httprouter.WithParams(bg, params)
|
||||
|
@ -244,8 +244,8 @@ func Test_KapacitorRulesGet(t *testing.T) {
|
|||
|
||||
actual := make([]chronograf.AlertRule, len(frame.Rules))
|
||||
|
||||
for idx, _ := range frame.Rules {
|
||||
actual[idx] = frame.Rules[idx].AlertRule
|
||||
for i := range frame.Rules {
|
||||
actual[i] = frame.Rules[i].AlertRule
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
|
|
|
@ -202,7 +202,7 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
|
|||
// Encapsulate the router with OAuth2
|
||||
var auth http.Handler
|
||||
auth, allRoutes.AuthRoutes = AuthAPI(opts, router)
|
||||
allRoutes.LogoutLink = "/oauth/logout"
|
||||
allRoutes.LogoutLink = path.Join(opts.Basepath, "/oauth/logout")
|
||||
|
||||
// Create middleware that redirects to the appropriate provider logout
|
||||
router.GET(allRoutes.LogoutLink, Logout("/", basepath, allRoutes.AuthRoutes))
|
||||
|
|
Loading…
Reference in New Issue