Skip to content

Commit 04fbee0

Browse files
committed
Updated index.html
1 parent acd99d5 commit 04fbee0

1 file changed

Lines changed: 12 additions & 105 deletions

File tree

public/index.html

Lines changed: 12 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
font-family: serif;
3939
font-size: 14pt;
4040
}
41-
41+
4242
.column {
4343
float: left;
4444
width: 33%;
@@ -48,7 +48,7 @@
4848
float: right;
4949
width: 9%;
5050
}
51-
51+
5252
h1 {
5353
cursor: pointer;
5454
font-weight: 300;
@@ -141,7 +141,7 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
141141
<a target="_blank" rel="noopener" href="https://store.rerum.io/API.html" class="linkOut">Read the API</a>).
142142
</p>
143143
<p class="handHoldy">
144-
After registering, you will be returned to this page with an Auth0 Authorization code.
144+
After registering, you will be returned to this page with an Auth0 Authorization code.
145145
</p>
146146
</div>
147147
<div class="panel-footer">
@@ -158,12 +158,10 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
158158
When you click <strong>Checks</strong>, several panels will appear to help you manage authentication:
159159
</p>
160160
<ul>
161-
<li><strong>Tokens</strong> — Displays your most recent Access Token and Refresh Token.</li>
162161
<li><strong>Auth0 Authorization Status</strong> — Shows whether you are currently recognized by Auth0.</li>
163162
<li><strong>Get A New Refresh Token</strong> — Lets you exchange an Auth0 Authorization Code for a brand new Refresh Token. ⚠️ This invalidates your old Refresh Token.</li>
164163
<li><strong>Access Token</strong> — Displays the Access Token generated alongside your Refresh Token and shows its expiration date.</li>
165164
<li><strong>Get A New Access Token</strong> — Allows you to generate a new Access Token using your Refresh Token.</li>
166-
<li><strong>Verify Any Token</strong> — Paste in any Access Token to check whether it is still valid.</li>
167165
<li><strong>Test RERUM API Access</strong> — Uses your Access Token to test if you can reach the RERUM API successfully.</li>
168166
</ul>
169167
<p>
@@ -194,31 +192,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
194192
<input class='btn btn-primary btn-large' type="button" id="check_status" value="Check my Authorization Status With Auth0" />
195193
</div>
196194
</div>
197-
<div class='panel panel-info' name="block" id="token-display-panel">
198-
<div class="panel-heading"> <span class="panel-title">Tokens</span>
199-
</div>
200-
<div class="panel-body">
201-
<div class = "column">
202-
<p class="handHoldy">
203-
Access Token: Valid for 30 days. You can refresh anytime.
204-
</p>
205-
<p class="handHoldy">
206-
<textarea readonly class="form-control" id="AccessTokenDisplay" placeholder="Your access token will appear here."></textarea>
207-
</p>
208-
</div>
209-
<div class = "column">
210-
<p class="handHoldy">
211-
Refresh Token: ⚠️ Most important token. Do not lose it.”
212-
</p>
213-
<p class="handHoldy">
214-
<textarea readonly class="form-control" id="RefreshTokenDisplay" placeholder="Your refresh token will appear here."></textarea>
215-
</p>
216-
</div>
217-
</div>
218-
<div class="panel-footer">
219-
<input class='btn btn-primary btn-large' type="button" id="download_token" value="Download Tokens" />
220-
</div>
221-
</div>
222195
<div class='panel panel-info' name="block" id="refresh-token-panel">
223196
<div class="panel-heading"> <span class="panel-title">Get A New Refresh Token</span> </div>
224197
<div class="panel-body">
@@ -233,14 +206,14 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
233206
<div>
234207
<div class="column">
235208
<span class="status_header"> Status </span>
236-
<kbd class="rerumStatus" id="nrtStatus">UNKNOWN</kbd>
237-
</div>
209+
<kbd class="rerumStatus" id="nrtStatus">UNKNOWN</kbd>
210+
</div>
238211
<div class="column2">
239212
<input class='btn btn-primary btn-large' type="button" id="copy_refresh_token" value="Copy" />
240213
</div>
241214
<div class="column2">
242215
<input class='btn btn-primary btn-large' type="button" id="download_refresh_token" value="Download" />
243-
</div>
216+
</div>
244217
</div>
245218
</div>
246219
<div class="panel-footer">
@@ -261,14 +234,14 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
261234
<div>
262235
<div class="column">
263236
<span class="status_header"> Access Token Expiration </span>
264-
<kbd class="rerumStatus" id="refreshAccessExp">UNKNOWN</kbd>
237+
<kbd class="rerumStatus" id="refreshAccessExp">UNKNOWN</kbd>
265238
</div>
266239
<div class="column2">
267240
<input class='btn btn-primary btn-large' type="button" id="copy_access_token" value="Copy" />
268241
</div>
269242
<div class="column2">
270243
<input class='btn btn-primary btn-large' type="button" id="download_access_token" value="Download" />
271-
</div>
244+
</div>
272245
</div>
273246
</div>
274247
</div>
@@ -291,24 +264,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
291264
<input class='btn btn-primary btn-large' type="button" id="request_token" value="Get A New Access Token" />
292265
</div>
293266
</div>
294-
<div class='panel panel-info' name="block" id="verify-any-token-panel">
295-
<div class="panel-heading">
296-
<span class="panel-title">Verify Any Token</span>
297-
</div>
298-
<div class="panel-body">
299-
<p class="handHoldy">
300-
Paste any access token here to check if it is still valid.
301-
</p>
302-
<textarea class="form-control" id="any_token_input" placeholder="Your token goes here."></textarea>
303-
<div>
304-
<span class="status_header"> Token Status </span>
305-
<kbd class="rerumStatus" id="anyTokenStatus">UNKNOWN</kbd>
306-
</div>
307-
</div>
308-
<div class="panel-footer">
309-
<input class='btn btn-primary btn-large' type="button" id="verify_any_token" value="Verify Token" />
310-
</div>
311-
</div>
312267
<div class='panel panel-info' name="block" id="test-api-panel">
313268
<div class="panel-heading"> <span class="panel-title">Test RERUM API Access</span> </div>
314269
<div class="panel-body">
@@ -412,7 +367,7 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
412367
window.history.replaceState({}, document.title, cleanUrl);
413368
}
414369
}
415-
370+
416371
$("#register").click(ev => {
417372
fetch('/client/register')
418373
.then(res => res.text())
@@ -457,7 +412,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
457412

458413
$("#refreshAccessExp").html(expString);
459414
$("#testAccessExp").html(expString);
460-
$("#AccessTokenDisplay").val(token.access_token);
461415

462416
$("#natStatus").html("SUCCESS");
463417
alert("The old access token has been invalidated. A new one is now active.");
@@ -470,7 +424,7 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
470424
let firstRefreshShown = false;
471425
$("#refresh_token").click(function() {
472426
if (!confirm("Requesting a new refresh token invalidates the old one. Do you want to continue?")) {
473-
return;
427+
return;
474428
}
475429

476430
const authCode = $("#code_for_refresh_token").val();
@@ -504,8 +458,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
504458

505459
$("#refreshAccessExp").html(expString);
506460
$("#testAccessExp").html(expString);
507-
$("#RefreshTokenDisplay").val(token.refresh_token);
508-
$("#AccessTokenDisplay").val(token.access_token);
509461

510462
$("#nrtStatus").html("SUCCESS");
511463
if (!firstRefreshShown) {
@@ -528,18 +480,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
528480
link.click();
529481
URL.revokeObjectURL(link.href);
530482
})
531-
532-
$("#download_token").click(function(){
533-
const link = document.createElement("a")
534-
const AccessTokenDownload = $("#AccessTokenDisplay").val()
535-
const RefreshTokenDownload = $("#RefreshTokenDisplay").val()
536-
const content = ["Access Token: " + AccessTokenDownload + "\nRefresh Token: " + RefreshTokenDownload]
537-
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
538-
link.href = URL.createObjectURL(blob);
539-
link.download = "AccessToken.txt";
540-
link.click();
541-
URL.revokeObjectURL(link.href);
542-
})
543483

544484
$("#download_refresh_token").click(function(){
545485
const link = document.createElement("a")
@@ -552,8 +492,7 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
552492
URL.revokeObjectURL(link.href);
553493
})
554494

555-
$("#copy_access_token").click(async function(){
556-
495+
$("#copy_access_token").click(async function(){
557496
const copyText = $("#a_t").val()
558497
try {
559498
await navigator.clipboard.writeText(copyText);
@@ -564,8 +503,7 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
564503
}
565504
});
566505

567-
$("#copy_refresh_token").click(async function(){
568-
506+
$("#copy_refresh_token").click(async function(){
569507
const copyText = $("#new_refresh_token").val()
570508
try {
571509
await navigator.clipboard.writeText(copyText);
@@ -576,37 +514,6 @@ <h1 onclick="window.location='https://rerum.io'" target="_blank" class="navbar-b
576514
}
577515
});
578516

579-
// Verify any token (access only for now)
580-
$("#verify_any_token").click(function() {
581-
const token = $("#any_token_input").val().trim();
582-
if (!token) {
583-
alert("Please paste a token.");
584-
return;
585-
}
586-
587-
// Simple malformed check (JWT should have 3 parts)
588-
if (token.split(".").length !== 3) {
589-
$("#anyTokenStatus").html("❌ Malformed token.");
590-
return;
591-
}
592-
593-
fetch('/client/verify', {
594-
headers: {
595-
Authorization: `Bearer ${token}`
596-
}
597-
})
598-
.then(res => {
599-
if (!res.ok) {
600-
throw new Error("Unauthorized");
601-
}
602-
// If the server says OK, then ✅ valid
603-
$("#anyTokenStatus").html("✅ Token is valid");
604-
})
605-
.catch(() => {
606-
$("#anyTokenStatus").html("❌ Token expired or invalid.");
607-
});
608-
});
609-
610517
function testAPI() {
611518
const userProvidedToken = $("#a_t").val();
612519
if (!userProvidedToken) {

0 commit comments

Comments
 (0)