Skip to content

Commit

Permalink
Revert "API should follow RequireSignInView (#8654) (#8661)" (#8674)
Browse files Browse the repository at this point in the history
This reverts commit ffff835.
  • Loading branch information
lunny authored and zeripath committed Oct 24, 2019
1 parent 66ceee0 commit 1bcbc02
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/topics", func() {
m.Get("/search", repo.TopicSearch)
})
}, securityHeaders(), reqTokenBySetting(), context.APIContexter(), sudo())
}, securityHeaders(), context.APIContexter(), sudo())
}

func securityHeaders() macaron.Handler {
Expand All @@ -857,10 +857,3 @@ func securityHeaders() macaron.Handler {
})
}
}

func reqTokenBySetting() macaron.Handler {
if setting.Service.RequireSignInView {
return reqToken()
}
return func(ctx *macaron.Context) {}
}

0 comments on commit 1bcbc02

Please sign in to comment.