refactor: 💡 deauth should delete the auth token (#1256)
This commit is contained in:
1 parent
e3324ad64a
commit
7386b2c9ed
4 files changed
+15
-10
No files matched your search
@@ -105,9 +105,13 @@ export default class BaseAuthenticator extends SimpleAuthBaseAuthenticator {
|
||||
* @override
|
||||
* @return {Promise}
|
||||
*/
|
||||
invalidate(options) {
|
||||
async invalidate(options) {
|
||||
const { token } = options;
|
||||
const deauthEndpointURL = this.buildDeauthEndpointURL(options);
|
||||
fetch(deauthEndpointURL, { method: 'post' }).catch(() => {
|
||||
await fetch(deauthEndpointURL, {
|
||||
method: 'delete',
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
}).catch(() => {
|
||||
/* no op */
|
||||
});
|
||||
return super.invalidate(...arguments);
|
||||
|
||||
Reference in new issue
Block a user