1
0
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:
Yury Shkoda
2022-01-05 14:51:33 +03:00
committed by GitHub

View File

@@ -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}`