Customise Expired Magic Link Page

What I’m trying to do:
I want my users to see a custom page whenever the login link is expired. Right now they will see the following page:

But ideally I will be able to show them something that looks like my actual website.

What I’ve tried and what’s not working:
I am sending the magic link to my registered users (see code below). But I don’t really see a way to change the existing /_/login/{token} page. I guess the only way might be by replicating the magic link functionality that Anvil has built and create my own token?

Code Sample:

anvil.users.send_token_login_email(email)  
2 Likes

The magic link is just a link with a token that’s taken care of by Anvil for you. But, you can build your own magic link mechanism by generating the link and sending the email via code. Since that link’s under your control, you can do whatever you want when the link is expired.

It’s a little trickier if you want to mix email/password logins with magic link logins, since you can’t rely on Anvil to manage the magic link logins anymore, but it would still work.

1 Like

I think what you’re trying to do is reasonable, but would be more of a feature request since it isn’t expressly available out of box at the moment.

But @jshaffstall’s work around should still work.