@rpcbase/client 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/index.js +3 -3
- package/package.json +1 -1
package/auth/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const log = debug("rb:auth")
|
|
|
12
12
|
// TODO: this should be refactored to AuthContext + Provider
|
|
13
13
|
|
|
14
14
|
let __is_authenticated = null
|
|
15
|
-
let __user_id = localStorage
|
|
15
|
+
let __user_id = localStorage?.getItem(UID_STORAGE_KEY)
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const run_session_check = async() => {
|
|
@@ -26,8 +26,8 @@ const run_session_check = async() => {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// Force trigger run first session check
|
|
30
|
-
run_session_check()
|
|
29
|
+
// Force trigger run first session check (when we are not in a webworker)
|
|
30
|
+
if (typeof window !== "undefined") run_session_check()
|
|
31
31
|
|
|
32
32
|
// manually run first check
|
|
33
33
|
// TODO: this should come from localStorage
|