Skip to content

Commit a478acd

Browse files
committed
fix: handle an edge case where headers is null
1 parent 74baac8 commit a478acd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/request-manager.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ export class RequestManager {
1414
if (config.headers?.authorization?.length) {
1515
return config
1616
}
17+
1718
try {
1819
const tokenSet = await this.client.refreshGrant()
1920

20-
if (tokenSet?.access_token) {
21+
if (tokenSet?.access_token && config.headers) {
2122
config.headers.authorization = `Bearer ${tokenSet?.access_token}`
2223
}
2324
} catch (error) {

0 commit comments

Comments
 (0)