-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
33 lines (30 loc) · 883 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
<head>
<title>JVS Caller Application</title>
<script type="text/javascript" src="helper.js"></script>
</head>
<body>
<h2>Sample app for token retrieval</h2>
<div>
<button id="auth-btn">Request a token</button>
<div id="output"></div>
</div>
<script type="text/javascript">
const helper = new Helper({
// url: `http://localhost:9091/popup`,
// CHANGE ME
// url: `https://jvs-ui-dev.tycho.joonix.net/popup`,
name: "auth-popup",
});
const button = document.querySelector("#auth-btn")
button.addEventListener("click", async (event) => {
try {
const { token } = await helper.requestToken();
document.getElementById("output").innerHTML = `Successfully retrieved token: ${token}`;
} catch (err) {
alert(`Failed to retrieve token: ${err}`);
}
});
</script>
</body>
</html>