(id: string)
| 33 | } |
| 34 | |
| 35 | destroy(id: string) { |
| 36 | const key = this.key(id); |
| 37 | const found = storage.get(key) as AdapterPayload | undefined; |
| 38 | const grantId = found?.grantId; |
| 39 | |
| 40 | if (found?.userCode) { |
| 41 | storage.delete(userCodeKeyFor(found.userCode)); |
| 42 | } |
| 43 | |
| 44 | storage.delete(key); |
| 45 | |
| 46 | if (grantId) { |
| 47 | const grantKey = grantKeyFor(grantId); |
| 48 | const tokens = storage.get(grantKey) as string[] | undefined; |
| 49 | tokens?.forEach(token => storage.delete(token)); |
| 50 | storage.delete(grantKey); |
| 51 | } |
| 52 | |
| 53 | return Promise.resolve(); |
| 54 | } |
| 55 | |
| 56 | consume(id: string) { |
| 57 | const key = this.key(id); |
no test coverage detected