mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 01:14:36 +00:00
Merge pull request #614 from sasjs/hot-fix-sasjs-server
fix(sasjs): restrict usage of localstorage for node env
This commit is contained in:
@@ -13,7 +13,7 @@ export class SasjsRequestClient extends RequestClient {
|
||||
|
||||
headers.Accept = contentType === 'application/json' ? contentType : '*/*'
|
||||
|
||||
if (!accessToken)
|
||||
if (!accessToken && typeof window !== 'undefined')
|
||||
accessToken = localStorage.getItem('accessToken') ?? undefined
|
||||
|
||||
if (accessToken) headers.Authorization = `Bearer ${accessToken}`
|
||||
|
||||
Reference in New Issue
Block a user