Skip to content

Commit 016ba1c

Browse files
smalininRubenVerborgh
authored andcommitted
Send credentials on logout (#13)
Send credentials on logout
1 parent 92c1fcf commit 016ba1c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/RelyingParty.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,17 @@ class RelyingParty extends JSONDocument {
397397
return Promise.reject(error)
398398
}
399399

400-
this.clearSession()
400+
if (!configuration.end_session_endpoint) {
401+
this.clearSession()
402+
return Promise.resolve(undefined)
403+
}
401404

402405
let uri = configuration.end_session_endpoint
403406
let method = 'get'
404407

405-
return fetch(uri, {method})
408+
return fetch(uri, {method, credentials: 'include'})
406409
.then(onHttpError('Error logging out'))
410+
.then(() => this.clearSession())
407411

408412
// TODO: Validate `frontchannel_logout_uri` if necessary
409413
/**

0 commit comments

Comments
 (0)