A quick question for those of you who use Supabase...
# off-topic
d
A quick question for those of you who use Supabase auth for both a web app and a phone app; how do you handle cases where a user requests a magic link, but opens that link on another device? For example: I attempt to login on the app on my phone, but I receive the email on my desktop and I try to open it from there?
s
This would just open the app on whichever device the link was sent to, I don't think there is any need to handle anything unless I'm got understanding your question correctly.
d
perhaps my example is a bit confusing here
let me try and restate the problem
Let's say I can't or don't want to open the link on the device I'm viewing the email on, but I want to continue in the app I requested the magic link from, because I'm placing an order, for example, and I already have the items in my shopping cart
Is there a good way of handling cases such as that? E.g. rather than clicking on the magic link, filling in a code from the email, as some sort of fallback option
s
Since there isn't really a concept of session as such on the frontend when using a JWT, you would probably have to save your shopping cart items into localStorage and then when the link is clicked and the user is logged in, they would still be available. At the moment with magic links there are no options to use a code or something like that as yet.
d
Alright, thanks! I thought as much, but I figured I might ask anyway in case someone thought of some clever solution 🙂
For now we'll just have to settle on logging to see if it happens much at all 🙂
s
Most apps which have magic-link support utilise associated domains or app links - essentially the app is linked to a domain, and links to that domain will prompt the user to open it in the app. On iOS: https://developer.apple.com/documentation/xcode/supporting-associated-domains On Android: https://developer.android.com/training/app-links