File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
lib/hooks/backchannelLogout Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11const { promisify } = require ( 'util' ) ;
22const { get : getClient } = require ( '../../client' ) ;
33
4- // Remove any Back-Channel Logout tokens for this `sub`
4+ // Remove any Back-Channel Logout tokens for this `sub` and `sid`
55module . exports = async ( req , config ) => {
66 const {
77 issuer : { issuer } ,
88 } = await getClient ( config ) ;
99 const { session, backchannelLogout } = config ;
1010 const store = ( backchannelLogout && backchannelLogout . store ) || session . store ;
1111 const destroy = promisify ( store . destroy ) . bind ( store ) ;
12- await destroy ( `${ issuer } |${ req . oidc . idTokenClaims . sub } ` ) ;
12+
13+ // Get the sub and sid from the ID token claims
14+ const { sub, sid } = req . oidc . idTokenClaims ;
15+
16+ // Remove both sub and sid based entries
17+ await Promise . all ( [
18+ destroy ( `${ issuer } |${ sub } ` ) ,
19+ sid && destroy ( `${ issuer } |${ sid } ` ) ,
20+ ] ) ;
1321} ;
You can’t perform that action at this time.
0 commit comments