@@ -4,13 +4,16 @@ function register() {
4
4
alert ( 2 ) ; window . location . href = "/register" ;
5
5
}
6
6
document . addEventListener ( 'DOMContentLoaded' , async function ( ) {
7
- if ( ! UI . authn . currentUser ( ) ) await UI . authn . checkUser ( ) ;
8
- let user = UI . authn . currentUser ( ) ;
7
+ const authn = UI . authn
8
+ const authSession = UI . authn . authSession
9
+
10
+ if ( ! authn . currentUser ( ) ) await authn . checkUser ( ) ;
11
+ let user = authn . currentUser ( ) ;
9
12
10
13
// IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT
11
14
if ( user ) {
12
15
window . localStorage . setItem ( keyname , user . uri ) ;
13
- await UI . authn . authSession . logout ( ) ;
16
+ await authSession . logout ( ) ;
14
17
}
15
18
else {
16
19
let webId = window . localStorage . getItem ( keyname ) ;
@@ -31,7 +34,7 @@ document.addEventListener('DOMContentLoaded', async function() {
31
34
let span = document . createElement ( "span" )
32
35
span . innerHTML = html
33
36
loginArea . appendChild ( span ) ;
34
- loginArea . appendChild ( UI . authn . loginStatusBox ( document , null , { } ) )
37
+ loginArea . appendChild ( UI . login . loginStatusBox ( document , null , { } ) )
35
38
const logInButton = loginArea . querySelectorAll ( 'input' ) [ 1 ] ;
36
39
logInButton . value = "Log in to see your WebID" ;
37
40
const signUpButton = loginArea . querySelectorAll ( 'input' ) [ 2 ] ;
0 commit comments