o1egl / paseto

Platform-Agnostic Security Tokens implementation in GO (Golang)
MIT License
852 stars 34 forks source link

Can't extend JSONToken #16

Closed ikorolev93 closed 4 years ago

ikorolev93 commented 4 years ago

I want to add my own claim to the JSONToken. I tried to use

type MyToken struct {
    paseto.JSONToken
    Groups []string `json:"groups"`
}

but it doesn't work (field does not appear in my token). There is JSONToken.Set, but it only works with strings.

o1egl commented 4 years ago

Hello, thank you for your report. I have received several similar requests for adding this functionality. Please follow this PR https://github.com/o1egl/paseto/pull/17

o1egl commented 4 years ago

PR is merged to master branch