Hi @apoorv-2204 ,
This is similar to your other post. In Retool, you shouldn’t be trying to call window.localStorage or window.sessionStorage directly. The sandbox blocks them.
Instead use Retool’s built-in storage API like:
localStorage.setValue("authToken", loginQuery.data.accessToken); and localStorage.values.authToken.
Yes I understand that. So in preloaded js , it does not refer to retools localStorage?.
Then how should I proceed further for having global functions?
I mean the local storage object of REtool
Hey there! It looks like this conversation has moved to this topic: Can't access global functions or sessionStorage - #2
Local storage values can only be set through the syntax that Shawn mentions, but as discussed in the other topic, it is best to keep authentication on the resource, rather than handling it in app variables

