From 5a69a61d4841a35d7ddcb761a688db8c688314d6 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 11 Nov 2018 11:28:29 -0800 Subject: Move UI middlewares and routes to ui package --- ui/oauth2_redirect.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ui/oauth2_redirect.go') diff --git a/ui/oauth2_redirect.go b/ui/oauth2_redirect.go index e54309a..85116cf 100644 --- a/ui/oauth2_redirect.go +++ b/ui/oauth2_redirect.go @@ -14,21 +14,20 @@ import ( "miniflux.app/ui/session" ) -// OAuth2Redirect redirects the user to the consent page to ask for permission. -func (c *Controller) OAuth2Redirect(w http.ResponseWriter, r *http.Request) { - sess := session.New(c.store, request.SessionID(r)) +func (h *handler) oauth2Redirect(w http.ResponseWriter, r *http.Request) { + sess := session.New(h.store, request.SessionID(r)) provider := request.RouteStringParam(r, "provider") if provider == "" { logger.Error("[OAuth2] Invalid or missing provider: %s", provider) - html.Redirect(w, r, route.Path(c.router, "login")) + html.Redirect(w, r, route.Path(h.router, "login")) return } - authProvider, err := getOAuth2Manager(c.cfg).Provider(provider) + authProvider, err := getOAuth2Manager(h.cfg).Provider(provider) if err != nil { logger.Error("[OAuth2] %v", err) - html.Redirect(w, r, route.Path(c.router, "login")) + html.Redirect(w, r, route.Path(h.router, "login")) return } -- cgit v1.2.3