Skip to content

Commit dcdae38

Browse files
committed
Beautifying the display of the JWT, claim and resource
1 parent 7204371 commit dcdae38

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

public/css/main.css

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,22 @@ textarea {
6262
========================================================================== */
6363

6464

65-
66-
67-
68-
69-
70-
71-
72-
73-
74-
75-
76-
65+
.code {
66+
border-color:#339;
67+
border-width:thin;
68+
border-style:dashed;
69+
width:700px;
70+
background-color:#DBE2EE;
71+
word-wrap:break-word;
72+
font-family:'Courier New', Courier, monospace;
73+
padding:5px;
74+
}
75+
76+
.resourceContainer {
77+
width:378px;
78+
height:284px;
79+
background-color:#CCC;
80+
}
7781

7882
/* ==========================================================================
7983
Media Queries

public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ <h1>Login</h1>
3636
</div>
3737
<div id="jwt" style="display:none">
3838
<h1>Current JWT</h1>
39-
<div id="token"></div>
39+
<div id="token" class="code"></div>
4040
<h2>Decoded JWT</h2>
41-
<div id="decodedToken"></div>
41+
<div id="decodedToken" class="code"></div>
4242
</div>
4343
<div id="resource" style="display:none">
4444
<h1>Resource</h1>
4545
<p>
4646
<input type="submit" name="btnGetResource" id="btnGetResource" value="Get Resource">
4747
<a href="resource.php" target="_blank">Try opening the resource directly</a></p>
48-
<div id="resourceContainer"></div>
48+
<div class="resourceContainer" id="resourceContainer"></div>
4949
</div>
5050
</div>
5151
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

public/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $(function(){
1111
store.claim = b64utos(a[1]);
1212

1313
$("#token").html(store.jwt);
14-
$("#decodedToken").html(store.claim);
14+
$("#decodedToken").html('<pre>' + JSON.stringify(JSON.parse(store.claim), null, 4) + '</pre>');
1515
$("#loginForm").hide();
1616
$("#jwt").show()
1717
$("#resource").show();

0 commit comments

Comments
 (0)