How is Phoenix.Token different from JWT?

Actually you’re right. I can use keyword lists, maps and structs as the payload just fine (although the token would be significantly longer the larger your data is). I think I was confused by the term “terms”, and found the definition on the erlang docs:

3.1 Terms

A piece of data of any data type is called a term.

And that also translates to any data that can be represented in Elixir. The downside is that you can’t easily decode the token payload on the client using the usual JSON-related libraries.

I’m afraid that made me more confused :slight_smile: then what is the purpose of having salt there and what is its intended use case? Is it for namespacing tokens (eg. for specific channel topics)?

1 Like