o1egl / paseto

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

example on readme fails, can't unmarshal token data to the given type of value. #7

Closed liminalitythree closed 6 years ago

liminalitythree commented 6 years ago

When running the example in the README, the local mode decryption step fails with error "can't unmarshal token data to the given type of value". Right now the library seems unusable.

liminalitythree commented 6 years ago

it seems to be thrown in the splitToken function when parsing the footer. If I set the footer parameter to nil it works fine.

CarbonFactory commented 6 years ago

Any update on this please ?

o1egl commented 6 years ago

Thank you for mentioning this error. There is mistake in README file. Please use it as err := v2.Decrypt(token, symmetricKey, &newJsonToken, &newFooter)

o1egl commented 6 years ago

Fixed in #6