Magic Link Passwordless - magic link could not be created
![Mr_English](https://us.v-cdn.net/6037124/user_avatars/1271230.jpg)
I implemented Magic Link passwordless, following the video by Prakash and set-up all the variables in the Settings page.
I get an error when I used the magic link page to login.
The message in Xano:
Even though the magic-link is not created, part of the login process works, e.g. a value is created in the magic_link record for that user:
I confirmed that the following values re all correct:
Sendgrid API key
Sendgrid magic link template
magic jwt secret
I ran the API /auth/magic-link and checked all the variables in the debugger:
They all have data, except the output at step 1.9:
Any suggestions how this problem is being caused?
Best Answer
-
Hi @Mr_English ! 👋
Thank you for the warm welcome!
So it looks like the error "Magic link could not be created. Try again." is being returned from Step 2 in the function stack of the /auth/magic-link endpoint. This error is being returned because the variablemagic_link
is null (not being generated).Now, we can dive into the
generate_magic_link
custom function to see where the variablemagic_link
is coming from.As you saw in the debugger, step 1.9 is not creating the magic_link. The value for the magic link is the environment variable
magic_link_redirect_uri
concatenated with the variablejwt
(coming from the step 8).This might be a good spot to start debugging. Make sure that both the environment variable
magic_link_redirect_uri
andmagic_jwt_secret
are correct under your workspace settingsAlso, I just ran through the video and instructions included in the Market place for using Magic Link With Sendgrid. I was able to run everything successfully, but I found myself going back and forth between reading the instructions and watching the video to ensure everything was implemented correctly. If you haven't gone through the written instructions, I highly recommend doing so.
Answers
-
@Prakash Chandran Sorry to bother - any chance you could have a look at this one?
-
@lizanaya Hi Liz! Any chance you could ask someone to look into this question please! Many thanks - and welcome to Xano!
-
@lizanaya Your detailed response is much appreciated.
I went through the settings and I noticed a small typo!
Also, it is necessary to put a forward slash at the end of the uri - mydomain.com/mypage/ or you get something like /mypageeyJhbGciOiJBMjU2S1ciLCJlbmMiOiJ
Thanks again. Tony
-
@Mr_English Awesome! 🙌 Glad to hear the issue was fixed!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback