How to get the token for verifying the user Answered
hello everyone how I can get the token for the user connected and sent it to the my backend to verify if the user valid
hello everyone how I can get the token for the user connected and sent it to the my backend to verify if the user valid
Comments
6 comments
Does this help?
https://docs.memberstack.com/hc/en-us/articles/7253255689755-Using-Permissions-and-Token-Verification-to-Secure-Your-Site#heading-3
You can ignore the permissions and just focus on the parts that mention the token.
yes it help but I always getting null Token values ? this is my code
exemple of returned data :
Hello Khaoula 👋
Thanks for providing the code 😀 I’m not a developer and I asked ChatGPT to see if they can help give us some clues.
“Based on the code you provided, it seems that you are trying to extract a cookie value from the request headers and send it back as a JSON response. However, you are always getting a null value for the token.
There could be a few reasons why this is happening. Here are some things you can try to debug the issue:
You can try these steps to debug the issue and find out why you are always getting a null value for the token.”
Josh Lopez Nicolas Scott If there’s anything you guys notice 😀
Yes, I wrote this code. Token is probably null because of this line:
It looks like the getCookie function that was meant to go with this code is missing.
You'll need to replace getCookie() with the actual token verification method from the admin SDK and pass in the token.
Like below:
I'll update the docs. Apologies for the confusion!
Thanks Nicolas 🙏 We appreciate all the work you do!
Jayess Nicolas Scott thank you very much for your answer 🙏
Please sign in to leave a comment.