File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -189,9 +189,12 @@ export const revoke = async (
189189
190190 revocationEndpoint = openidConfig . revocation_endpoint ;
191191 }
192- let basicAuth ;
192+
193+ const headers = {
194+ 'Content-Type' : 'application/x-www-form-urlencoded' ,
195+ } ;
193196 if ( includeBasicAuthorization ) {
194- basicAuth = base64 . encode ( `${ clientId } :${ clientSecret } ` ) ;
197+ headers . Authorization = `basic ${ base64 . encode ( `${ clientId } :${ clientSecret } ` ) } ` ;
195198 }
196199 /**
197200 Identity Server insists on client_id being passed in the body,
@@ -201,10 +204,7 @@ export const revoke = async (
201204 **/
202205 return await fetch ( revocationEndpoint , {
203206 method : 'POST' ,
204- headers : {
205- 'Content-Type' : 'application/x-www-form-urlencoded' ,
206- Authorization : `${ includeBasicAuthorization ? `basic ${ basicAuth } ` : '' } ` ,
207- } ,
207+ headers,
208208 body : `token=${ tokenToRevoke } ${ sendClientId ? `&client_id=${ clientId } ` : '' } ` ,
209209 } ) . catch ( error => {
210210 throw new Error ( 'Failed to revoke token' , error ) ;
You can’t perform that action at this time.
0 commit comments