-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passwordless.CreateMagicLinkByEmail doesn't pass along response.OK.CodeLifetime #428
Comments
That is true, however, the lifetime is statically defined in the core config anyway, so the golang code can use the same value (though yea, you would be repeating that value in two places, which is not ideal). We can change this func to return the link and the lifetime, however, this will be a low priority task for us. |
Low priority for sure. I wouldn't mind sending you a PR if I had an idea the approach you wanted to take -- whether to change the function signature of In support of the motivation: You can't really "use the same value" in both places, as it's not necessarily available in the other place. You could hard-code it based on what you know the server is set up to use (which is what I'm doing now), but that's not terribly robust: What if the default changes at some point? Or what if you add the ability to change the expiration length? As you say, not huge priority, but definitely worth fixing to avoid little issues down the road. Let me know if you're open to a PR, and if so, what approach you'd prefer. |
We would want to change the func signature of |
When overriding a hook for sending an email as part of the auth workflow, not only the link but also the lifetime of the link is provided, allowing the email (or whatever presentation) to tell the user how long to expect the link to work.
However, when creating a link outside of the normal auth flow with
CreateMagicLinkByEmail
, the CodeLifetime is discarded, meaning it's impossible (without making assumptions) to tell the user how long the lifetime will last.The text was updated successfully, but these errors were encountered: