Skip to content

Commit c773c81

Browse files
committed
Implements open search to decode tokens.
1 parent 013f3b9 commit c773c81

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

dist/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

html/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<link rel="stylesheet" href="vendor/auth0-styleguide/css/index.css" type="text/css" media="all" />
1919
<link rel="stylesheet" href="css/app.css" type="text/css" media="all" />
2020
<!-- endbuild -->
21+
<link rel="search" type="application/opensearchdescription+xml" title="JWT.io" href="/opensearch.xml" />
2122

2223
<!-- Bootstrap core CSS -->
2324

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
6+
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
77
<meta name="author" content="auth0.com">
88
<meta name="description" content="JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed using JSON Web Signature (JWS).">
99

@@ -13,6 +13,7 @@
1313
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
1414

1515
<link rel="stylesheet" href="dist/css/app.css" media="all">
16+
<link rel="search" type="application/opensearchdescription+xml" title="JWT.io" href="/opensearch.xml">
1617

1718
<!-- Bootstrap core CSS -->
1819

js/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@
189189
secretElement.addEventListener('keyup', updateSignature, false);
190190
isBase64EncodedElement.addEventListener('change', updateSignature, false);
191191

192+
if (document.location.search) {
193+
var qs = document.location.search.slice(1);
194+
var d = {};
195+
qs = qs.split('&');
196+
qs.forEach(function (kv) { kv = kv.split('='); d[kv[0]] = kv[1]; });
197+
if (d.value) {
198+
tokenEditor.setValue(decodeURIComponent(d.value));
199+
return;
200+
}
201+
}
202+
192203
loadFromStorage(function (jwt) {
193204
tokenEditor.setValue(
194205
jwt || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1Njc4OTAsIm5hbWUiOiJKb2huIERvZSIsImFkbWluIjp0cnVlfQ.eoaDVGTClRdfxUZXiPs3f8FmJDkDE_VCQFXqKxpLsts'

0 commit comments

Comments
 (0)