@@ -55,22 +55,23 @@ <h2>Finish by issuing credentials in the form of a certificate</h2>
5555
5656< script type ="text/javascript ">
5757
58+ document . querySelector ( '#cert' ) . style . display = 'none'
59+
5860function createAccount ( ) {
59- var email = document . querySelector ( "#email" ) . value
60- var hostname = location . hostname
61+ var email = document . querySelector ( '#email' ) . value
6162 var url = '/accounts/new'
62- var data = " email=" + email ;
63+ var data = ' email=' + email
6364
6465 var http = new XMLHttpRequest ( )
6566 http . open ( 'POST' , url )
6667 http . withCredentials = true
67- http . setRequestHeader ( " Content-Type" , " application/x-www-form-urlencoded" )
68- http . onreadystatechange = function ( ) {
69- if ( this . readyState !== this . DONE
70- || this . status !== 200 ) {
68+ http . setRequestHeader ( ' Content-Type' , ' application/x-www-form-urlencoded' )
69+ http . onreadystatechange = function ( ) {
70+ if ( this . readyState !== this . DONE ||
71+ this . status !== 200 ) {
7172 return done ( new Error ( 'Request failed' ) )
7273 }
73- var webid = this . getResponseHeader ( " User" )
74+ var webid = this . getResponseHeader ( ' User' )
7475 if ( ! webid || webid . length === 0 ) {
7576 return done ( new Error ( 'WebID is not set in User' ) )
7677 }
@@ -79,7 +80,6 @@ <h2>Finish by issuing credentials in the form of a certificate</h2>
7980 document . querySelector ( '#your-webid' ) . innerHTML = webid
8081 document . querySelector ( '#accounts' ) . style . display = 'none'
8182 document . querySelector ( '#cert' ) . style . display = ''
82-
8383 }
8484 http . send ( data )
8585}
@@ -99,8 +99,6 @@ <h2>Finish by issuing credentials in the form of a certificate</h2>
9999 }
100100}
101101
102- document . querySelector ( '#cert' ) . style . display = 'none'
103-
104102function done ( err ) {
105103 if ( err ) {
106104 console . log ( err )
0 commit comments