We have an affiliate who will link their customers to a specific page on our site. They're sending a JSON web token that we need to verify to approve whether they can see the page or not. Just looking for guidance to see if we can have the ability to run any server-side functions like validating the JWT or help with what might be possible within Shopify? I have created a simple JWT app on Heroku that returns a simple yes or no reponse if the token is valid, but am stuck on how to use it within shopify.
Is this on a product page? Something else? Perhaps the external tool validating the user also returns the content to display in an ajax response.
Maybe you instead get customers to log into an account first that you've already validated in some way.
Some further context would help.
Hey Jason! This is for a collection page. The request for this has come from an affiliate to show a page based on a JWT. Before this, I had set up a simple liquid boolean based on a query string (as they're visitors without tags) in the URL but they would prefer something more secure.
The external tool is a simple python app that looks for a token in the header — here is a duplicate example of it https://jwt-example-app.herokuapp.com/validate-token — I was hoping to somehow utilise this when their customers lands on the collection.
If that's not possible, I'd definitely be interested in how to serve the content with AJAX once they are validated.
|2 hours ago|
|6 hours ago|
|7 hours ago|
|8 hours ago|
|8 hours ago|