Ianleeclark/Paseto

Question: is it safe to forward {:error, message} from parse_token to the HTTP client?

Closed this issue · 2 comments

Apologies for opening an issue just for a question.

When using parse_token inside a Plug, I'm wondering whether I need to match on the message returned in an {:error, message} tuple, or is it safe to just forward the message as part of the HTTP response? Would I be giving away too much in this case?

Thanks for the quick response, I appreaciate your help.

I was being too vague -- in our case the user is a developer coding against our API, so seeing "wrong version" might actually be helpful here. If there are no significant downsides then I'm leaning towards returning the message together with a 401 response.

In either case I'm closing this issue since it was just a question. 🙂