You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
Describe the feature
Hi Team,
I tried the below code it's working fine but my concern is that I need to store the data or value in the session storage and to use data globally
async function getToken() {
const response = await axios.get(
"api/url",
);
const data = await response;
return data;
}
(async () => {
return (await getToken()).data;
})()
let resToken = getToken();
console.log(resToken) // Promise { }
resToken.then(function(result) {
console.log(result.data); // "Some User token"
})
Thanks in Advance
Additional information
Final checks
The text was updated successfully, but these errors were encountered: