Is there a way to send both Magic Link and OTP together in one email?
During signin/signup I want to send users both Magic link and OTP in one email and user can choose to either login with magic link or enter OTP.
Currently we have two separate plugins to send magic link and email OTP. Are there any known workarounds to combine them?
5 Replies
@Better Auth
Hey there! It looks like you're reaching out—how can I help you today with Better Auth? Here are some common topics the community has been discussing recently:
• For Discord integration, make sure you’re setting up your client ID, client secret, and redirect URI correctly in your auth configuration. For example, the docs show you should use a redirect URL like http://localhost:3000/api/auth/callback/discord for local development [1].
• If you’re concerned about privacy with Discord’s email scope, there have been discussions on offering a dummy email option or even using Discord's unique user ID instead of an email address [2], [3]. This helps address users’ trust issues without compromising functionality.
• Some users are interested in configuring Discord bot permissions during OAuth, which Better Auth supports through an optional permissions parameter. This allows you to fine-tune the bot capabilities when authorizing [4].
• If you’re running into issues like invalid OAuth URLs (for instance, the missing "++" prefix before the redirect_uri parameter), note that this has been addressed in the issues where Better Auth now includes the necessary prefix to meet Discord’s requirements [6].
Feel free to ask if you need more details on any of these points or have another question about Better Auth!
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
Build software better, together
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Sources:
[1] Discord | Better Auth
[2] feat:Add Discord OAuth email scope configuration field
[3] feat: Discord Oauth without the email scope
[4] feat: add Discord bot permissions parameter support
[6] Discord OAuth redirect_uri requires double plus signs (++) prefix - Better Auth generates invalid URLs
Discord | Better Auth
Discord provider setup and usage.
GitHub
feat:Add Discord OAuth email scope configuration field by Summerlyt...
Collecting the real email address is a privacy concern. By implementing this simple fix, it allows users to replace said address with a dummy address easily. I understand you can write over the ema...
GitHub
feat: Discord Oauth without the email scope · Issue #2059 · bette...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. I find collecting email addresses a potential privacy concern depending on t...
GitHub
feat: add Discord bot permissions parameter support by TheUntraceab...
When using the Discord social plugin, you can set the bot scope, and this scope can have an additional permissions scope, referring to the permissions of the Discord Bot once authorized.
This pull ...
GitHub
Discord OAuth redirect_uri requires double plus signs (++) prefix -...
Is this suited for github? Yes, this is suited for github To Reproduce Create Expo app with Better Auth Configure Better Auth with Discord OAuth provider Set redirect URL in Discord Developer Dashb...
I wouldve suggested not using one of them and generating the it in the method of the other (disable otp, generate otp along with magic link) but thats not possible. Maybe just have a link to the right page with the otp as a QS parameter in the URL to prefill?
Thanks for the suggestion. The issue with having OTP in query param is that if user opens the link in a different device/browser, then just the OTP will be not be sufficient.
Either I'll have to
a) Ask for user's email there manually (Extremely bad UX)
b) Pass the email along with otp in query param 
/verify?otp=123456&email=user@example.com (Security concerns, PII exposure, logging issues)
