File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export default class SolidAuthClient extends EventEmitter {
7676 const session = await getSession ( storage )
7777 if ( session ) {
7878 try {
79- await WebIdOidc . logout ( storage )
79+ await WebIdOidc . logout ( storage , globalFetch )
8080 this . emit ( 'logout' )
8181 this . emit ( 'session' , null )
8282 } catch ( err ) {
Original file line number Diff line number Diff line change @@ -55,11 +55,21 @@ export async function currentSession(
5555 }
5656}
5757
58- export async function logout ( storage : AsyncStorage ) : Promise < void > {
58+ export async function logout (
59+ storage : AsyncStorage ,
60+ fetch : Function
61+ ) : Promise < void > {
5962 const rp = await getStoredRp ( storage )
6063 if ( rp ) {
6164 try {
62- rp . logout ( )
65+ // First log out from the IDP
66+ await rp . logout ( )
67+ // Then, log out from the RP
68+ try {
69+ await fetch ( '/.well-known/solid/logout' , { credentials : 'include' } )
70+ } catch ( e ) {
71+ // Ignore errors for when we are not on a Solid pod
72+ }
6373 } catch ( err ) {
6474 console . warn ( 'Error logging out of the WebID-OIDC session' )
6575 console . error ( err )
You can’t perform that action at this time.
0 commit comments