Issue with injecting Bearer token from local storage to API header

I am trying to attach a token that is generated using generate otp resource in the login app and stored in the local storage. The token is persisted in local storage but can not be retrieved in another resource header value.

When I pass a valid token as a string in the header value
Bearer MY_TOKEN_AS_A_STRING” , the request works. When I try to retrieve the token from localStorage “Bearer {{localStorage.values.token” it does not work.

Hi @yazeed, welcome to the forum! :wave:

Although we can probably find a way to make this work, we would not advice you to save any private information in localStorage. We should only keep publicly accessible data there because it's not secure.

Here is a great quote:

"Storing in local storage any sensitive information is equivalent to posting on Twitter or Instagram that information." - Source

Could you expand on your use case? Setting up Custom API authentication may be the best route to take.