diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-11-11 11:28:29 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-11-11 11:29:12 -0800 |
commit | 5a69a61d4841a35d7ddcb761a688db8c688314d6 (patch) | |
tree | b807ee1da5b0705e7649f70742d8198f351c1224 /ui/oauth2_redirect.go | |
parent | 0925899cee9362cf09e982487bd480e2b09041f4 (diff) |
Move UI middlewares and routes to ui package
Diffstat (limited to 'ui/oauth2_redirect.go')
-rw-r--r-- | ui/oauth2_redirect.go | 11 |
1 files changed, 5 insertions, 6 deletions
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 } |