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 (
189
189
190
190
revocationEndpoint = openidConfig . revocation_endpoint ;
191
191
}
192
- let basicAuth ;
192
+
193
+ const headers = {
194
+ 'Content-Type' : 'application/x-www-form-urlencoded' ,
195
+ } ;
193
196
if ( includeBasicAuthorization ) {
194
- basicAuth = base64 . encode ( `${ clientId } :${ clientSecret } ` ) ;
197
+ headers . Authorization = `basic ${ base64 . encode ( `${ clientId } :${ clientSecret } ` ) } ` ;
195
198
}
196
199
/**
197
200
Identity Server insists on client_id being passed in the body,
@@ -201,10 +204,7 @@ export const revoke = async (
201
204
**/
202
205
return await fetch ( revocationEndpoint , {
203
206
method : 'POST' ,
204
- headers : {
205
- 'Content-Type' : 'application/x-www-form-urlencoded' ,
206
- Authorization : `${ includeBasicAuthorization ? `basic ${ basicAuth } ` : '' } ` ,
207
- } ,
207
+ headers,
208
208
body : `token=${ tokenToRevoke } ${ sendClientId ? `&client_id=${ clientId } ` : '' } ` ,
209
209
} ) . catch ( error => {
210
210
throw new Error ( 'Failed to revoke token' , error ) ;
You can’t perform that action at this time.
0 commit comments