Closed PavankalyanPayyavula closed 7 months ago
Any update?
When you're being redirected to login callback page, it takes some time to obtain tokens and update auth state. So I recommend you to use $auth.authStateManager
onMounted(() => {
$auth.authStateManager.subscribe((authState) => {
if (authState.isAuthenticated) {
const accessToken = $auth.getAccessToken();
axios.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;
loggedInUser.getLoggedinUserFromAPI();
}
});
});
Describe the bug
When we login into app for the first time $auth.IsAuthenticated() is returning false on initial load. When we refresh the application then $auth.IsAuthenticated() is returning true.
Using Vue3, Composition API.
In main.js -->
In App.vue -->
Reproduction Steps?
By the configuration mentioned above, on the initial load await $auth.isAuthenticated() is failing to send the true.
SDK Versions
package.json
Additional Information
No response