Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: scheduler/appengine/ui/common.go

Issue 2830443003: auth: Refactor how authentication methods are passed to server/auth library. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scheduler/appengine/ui/common.go
diff --git a/scheduler/appengine/ui/common.go b/scheduler/appengine/ui/common.go
index 400eb49a922feaa3234e6ce2510f957c1c1eee5f..3e638e62a33af563d271571693abb8a66ac0d3b1 100644
--- a/scheduler/appengine/ui/common.go
+++ b/scheduler/appengine/ui/common.go
@@ -12,6 +12,7 @@ import (
"github.com/luci/gae/service/info"
+ "github.com/luci/luci-go/appengine/gaeauth/server"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/auth/xsrf"
"github.com/luci/luci-go/server/router"
@@ -35,7 +36,13 @@ func InstallHandlers(r *router.Router, base router.MiddlewareChain, cfg Config)
m := base.Extend(func(c *router.Context, next router.Handler) {
c.Context = context.WithValue(c.Context, configContextKey(0), &cfg)
next(c)
- }, templates.WithTemplates(tmpl), auth.Authenticate)
+ })
+ m = m.Extend(
+ templates.WithTemplates(tmpl),
+ auth.Authenticate(&auth.Authenticator{
+ Methods: []auth.Method{server.CookieAuth},
+ }),
+ )
r.GET("/", m, indexPage)
r.GET("/jobs/:ProjectID", m, projectPage)

Powered by Google App Engine
This is Rietveld 408576698