the key is returning undefined when i try to create a jwt
Answered
subscr posted this in #help-forum
subscrOP
Answered by James4u
oh I see so it should be session.profile.id instead of session.user.id
32 Replies
subscrOP
probably because the session took a long time to load and was already direct to useEffect.
@subscr you created a new one - was replying in the previous one
sorry I didn't see your code deeply
so couple of bugs there
so first of all add
session to the dependency array of your useEffect@James4u <@1053131637187149905> you created a new one - was replying in the previous one
subscrOP
sorry, i thought that, that topic has already been solved another problem, to get more organized I created this
and in your
useEffect check session?.user?.id and return; before making axios callsubscrOP
like this?
yeah, exactly
subscrOP
now nothing happens, apparently it stops at the if(!token) return null
first of all see your backend console if you are getting correct api request
@subscr
not much following you
plz be clear at your communication as I am not familar with your codebase
@James4u plz be clear at your communication as I am not familar with your codebase
subscrOP
basically, user.id returns undefined and profile.id returns the user id
oh I see so it should be session.profile.id instead of session.user.id
Answer
subscrOP
sorry anything, I don't speak English very well, I'm using google translator
no worries
so is everything working fine?
@James4u oh I see so it should be session.profile.id instead of session.user.id
subscrOP
yes, I switched and it worked, incredible as it may seem
i will mark as resolved, thank you again!
sure then close this thread
Original message was deleted
🙂