K
Kinde6mo ago
Sivasish

conditional components is not showing

After logging in i cannot see anything (like some small components as the logout button and profile logo) at the header even after using the isLoading and isAuthenticated from useKindAuth()
No description
No description
5 Replies
Daniel_Kinde
Daniel_Kinde6mo ago
You need to await the method isAuthenticated. e.g.
{!(await isAuthenticated()) ? (
Not logged in
) : (
logged in
)
}
{!(await isAuthenticated()) ? (
Not logged in
) : (
logged in
)
}
I would strongly advocate you using typescript, it would assisted capturing this issue
Sivasish
SivasishOP6mo ago
will this particular thing work properly after the use of typescript here? or any other issue regardless of the adice to use typescript??
Daniel_Kinde
Daniel_Kinde6mo ago
Typescript would have just pointed out the unhandled promise. Have you tried my code example by awaiting the isAuthenticated?
Sivasish
SivasishOP6mo ago
yes I handled it mannualy and also with useffect(with async await) ,,those parts of the header is refering to loading and in conle it is showing is isAunthenticate() is not a function though ,, I assume it is a boolean expression.. and also when i do the console.log(user) it is saying undefind... in header as well as in dashboard the user is undefind
Daniel_Kinde
Daniel_Kinde6mo ago
HI @Sivasish , I wanted to check in with you to see if you have been able to progress. Keen to understand your issue more in case we can improve our documentation or SDK DX feedback.
Want results from more Discord servers?
Add your server