I need to share a encrypted token with anonymous users that allows them to access a particular route and say, few product ids.

This token is then shared with users via email.

Hence, the token may contain an array of those product-ids.

I have been looking some mechanism to generate token from those data.

But seems like JWT and Passport requires user's credentials to validate and then generate tokens.

How can I encrypt these data into token without user login and registration?

0 Answers