Tweak token response for ESA1.0
This commit is contained in:
parent
dd4fbc4cf8
commit
88d1bb5fe4
2 changed files with 7 additions and 5 deletions
|
@ -13,9 +13,11 @@ var (
|
|||
Middleware *jwt.Middleware
|
||||
// Config handles JWT middleware configuration
|
||||
Config = &jwt.Config{
|
||||
Secret: os.Getenv("SECRET"),
|
||||
Auth: models.DbAuthenticate,
|
||||
Claims: claimsFunc,
|
||||
Secret: os.Getenv("SECRET"),
|
||||
Auth: models.DbAuthenticate,
|
||||
Claims: claimsFunc,
|
||||
IdentityField: "username",
|
||||
VerifyField: "password",
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func tokenHandler(h http.Handler) http.Handler {
|
|||
})
|
||||
} else {
|
||||
data, _ = json.Marshal(struct {
|
||||
Token string `json:"token"`
|
||||
Token string `json:"access_token"`
|
||||
}{
|
||||
Token: tokenData,
|
||||
})
|
||||
|
@ -92,7 +92,7 @@ func tokenRefresh(j *jwt.Middleware) errorHandler {
|
|||
}
|
||||
|
||||
data, _ := json.Marshal(struct {
|
||||
Token string `json:"token"`
|
||||
Token string `json:"access_token"`
|
||||
}{
|
||||
Token: token,
|
||||
})
|
||||
|
|
Reference in a new issue