Fix NewJWT to return JWT rather than mrfusion.Authenticator

pull/10616/head
Chris Goller 2016-10-19 17:56:58 -05:00
parent 693377caba
commit cdf24e109f
2 changed files with 5 additions and 4 deletions

View File

@ -20,8 +20,8 @@ type JWT struct {
}
// NewJWT creates a new JWT using time.Now; secret is used for signing and validating.
func NewJWT(secret string) mrfusion.Authenticator {
return &JWT{
func NewJWT(secret string) JWT {
return JWT{
Secret: secret,
Now: time.Now,
}

View File

@ -252,16 +252,17 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler {
Name: "session",
}
a := jwt.NewJWT(authFlags.TokenSecret)
handler = handlers.AuthorizedToken(a, &e, logger, handler)
handler = handlers.AuthorizedToken(&a, &e, logger, handler)
}
// TODO: Fix these routes when we use httprouter
auth := jwt.NewJWT(authFlags.TokenSecret)
gh := handlers.NewGithub(
authFlags.GithubClientID,
authFlags.GithubClientSecret,
successURL,
failureURL,
jwt.NewJWT(authFlags.TokenSecret),
&auth,
logger,
)