diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-09-03 14:26:40 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-09-03 14:26:40 -0700 |
commit | eee1f3190355224eef63a4dcdef8c36eb3ca3738 (patch) | |
tree | 009b7ca67b96d9be473d8ddf2c8c95f22a6749d1 /ui/login_show.go | |
parent | 88e81d4d800ff6433518522954197d75203a25c2 (diff) |
Refactor HTTP context handling
Diffstat (limited to 'ui/login_show.go')
-rw-r--r-- | ui/login_show.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/login_show.go b/ui/login_show.go index d963df5..82c19ec 100644 --- a/ui/login_show.go +++ b/ui/login_show.go @@ -7,8 +7,8 @@ package ui // import "miniflux.app/ui" import ( "net/http" - "miniflux.app/http/context" "miniflux.app/http/response" + "miniflux.app/http/request" "miniflux.app/http/response/html" "miniflux.app/http/route" "miniflux.app/ui/session" @@ -17,13 +17,12 @@ import ( // ShowLoginPage shows the login form. func (c *Controller) ShowLoginPage(w http.ResponseWriter, r *http.Request) { - ctx := context.New(r) - if ctx.IsAuthenticated() { + if request.IsAuthenticated(r) { response.Redirect(w, r, route.Path(c.router, "unread")) return } - sess := session.New(c.store, ctx) - view := view.New(c.tpl, ctx, sess) + sess := session.New(c.store, request.SessionID(r)) + view := view.New(c.tpl, r, sess) html.OK(w, r, view.Render("login")) } |