Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

Equivalent jst.sign in frontend development without 'require' // uncompiled new to HTML / front end]

$
0
0

I am having some difficulty understanding how to sign a url in a browser.

To give you n idea of what I am attempting to achieve:

var token = jwt.sign(payload, SECRET_KEY);
var iframeUrl = SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true";

However, obviously browsers cannot use:

var jwt = require("jsonwebtoken");

Furthermore, in normal practice, one would not want to have the key in the front end, but this is just for a raspberry pi to be used as a dashboard in a local network so I'm overlooking it for now. I've been teaching myself HTML / frontend for two days so some basic explanation may be required. Thanks in advance!!!

I've just had a look through the 'tags' for this post and noticed something called requireJS which I'm going to take a look into now but I'll still post this, cheers all!


Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>