Skip to content

Commit 3e31cc5

Browse files
Show webId and providerUri in demo app
1 parent 374f25f commit 3e31cc5

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎demo/index.html‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ <h3>Solid Auth Demo Page</h3>
2424
<div class="demo-section">
2525
<h5>App body</h5>
2626
<p>The rest of the app goes here</p>
27+
<div class="container">
28+
<div class="row">
29+
<div class="col-md-1 text-right"><code>webId</code></div>
30+
<div class="col-md-11"><code id="webId"></code></div>
31+
</div>
32+
<div class="row">
33+
<div class="col-md-1 text-right"><code>provider</code></div>
34+
<div class="col-md-11"><code id="providerUri"></code></div>
35+
</div>
36+
</div>
2737
</div>
2838
</div>
2939
</body>
@@ -39,8 +49,26 @@ <h5>App body</h5>
3949
onLoginSuccess: function (webId, accessToken) {
4050
console.log('onLoginSuccess() callback! webId: ', webId,
4151
'access_token: ', accessToken)
52+
setField('webId', webId)
53+
},
54+
onProviderSelected: function (providerUri) {
55+
setField('providerUri', providerUri)
4256
}
4357
})
4458
})
59+
60+
function setField (id, value) {
61+
var field = document.getElementById(id)
62+
if (field) {
63+
field.innerHTML = value
64+
}
65+
}
66+
function hide (id) {
67+
document.getElementById(id).className = 'hidden'
68+
}
69+
function show (id) {
70+
var div = document.getElementById(id)
71+
div.className = div.className.replace('hidden', '')
72+
}
4573
</script>
4674
</html>

0 commit comments

Comments
 (0)