File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,3 +35,5 @@ node_modules
3535# Build dirs
3636lib
3737dist
38+ demo /solid-client.min.js *
39+
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ <h5>App body</h5>
6464 document . addEventListener ( 'DOMContentLoaded' , function ( ) {
6565 window . addEventListener ( 'message' , onMessage )
6666 init ( )
67- SolidClient . auth . currentUser ( )
67+ SolidClient . currentUser ( )
6868 . then ( function ( webId ) {
6969 loginSuccess ( webId )
7070 } )
@@ -85,7 +85,7 @@ <h5>App body</h5>
8585 }
8686
8787 function loginTo ( providerUri ) {
88- SolidClient . auth . login ( providerUri )
88+ SolidClient . login ( providerUri )
8989 . then ( function ( webId ) {
9090 loginSuccess ( webId )
9191 } )
@@ -110,7 +110,15 @@ <h5>App body</h5>
110110 }
111111
112112 function logout ( ) {
113- alert ( 'logging out' )
113+ SolidClient . logout ( )
114+ . then ( function ( ) {
115+ console . log ( 'logged out' )
116+ hide ( 'logoutDiv' )
117+ setField ( 'webId' , SolidClient . auth . webId )
118+ } )
119+ . catch ( function ( err ) {
120+ console . error ( 'Error logging out: ' , err )
121+ } )
114122 }
115123
116124 function getRootAcl ( ) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -192,6 +192,14 @@ class ClientAuthOIDC {
192192 this . idToken = null
193193 }
194194
195+ logout ( ) {
196+ this . clearCurrentUser ( )
197+ if ( ! this . currentClient ) {
198+ return Promise . resolve ( null )
199+ }
200+ return this . currentClient . logout ( )
201+ }
202+
195203 /**
196204 * Resolves to the URI of an OIDC identity provider, from one of the following:
197205 *
You can’t perform that action at this time.
0 commit comments