@@ -20,7 +20,8 @@ const contentTypeJWT = "application/jwt"
2020const contentTypeJSON = "application/json"
2121const contentTypePlain = "text/plain"
2222
23- type userClaimsFunc func (userInfo model.UserInfo ) (jwt.Claims , error )
23+ // UserClaimsFunc returns jwt.Claims
24+ type UserClaimsFunc func (userInfo model.UserInfo ) (jwt.Claims , error )
2425
2526// Handler is the mail login handler.
2627// It serves the login ressource and does the authentication against the backends or oauth provider.
@@ -31,7 +32,7 @@ type Handler struct {
3132 signingMethod jwt.SigningMethod
3233 signingKey interface {}
3334 signingVerifyKey interface {}
34- userClaims userClaimsFunc
35+ UserClaims UserClaimsFunc
3536}
3637
3738// NewHandler creates a login handler based on the supplied configuration.
@@ -70,7 +71,7 @@ func NewHandler(config *Config) (*Handler, error) {
7071 backends : backends ,
7172 config : config ,
7273 oauth : oauth ,
73- userClaims : userClaims .Claims ,
74+ UserClaims : userClaims .Claims ,
7475 }, nil
7576}
7677
@@ -277,9 +278,9 @@ func (h *Handler) respondAuthenticatedHTML(w http.ResponseWriter, r *http.Reques
277278
278279func (h * Handler ) createToken (userInfo model.UserInfo ) (string , error ) {
279280 var claims jwt.Claims = userInfo
280- if h .userClaims != nil {
281+ if h .UserClaims != nil {
281282 var err error
282- claims , err = h .userClaims (userInfo )
283+ claims , err = h .UserClaims (userInfo )
283284 if err != nil {
284285 return "" , err
285286 }
0 commit comments