Like as a thought exercise, trying to get magic links to be bound to the device that caused the sign-in.
My solution would be to ask the back-end to send the email. Then have the back-end send an email and respond with an additonal token. The front-end could store this into local storage, so that when the link in the email is clicked, the front-end can send both the email and local storage tokens to the back-end to authenticate.
Alternatively, maybe the back-end could set a cookie and also remember a redirect url. Then the email could open the url at the back-end server (which could be different from the website domain where the client lives). The back-end server can then check the email code and the cookie it set earlier to authenticate.