[GH-ISSUE #8853] signIn.emailOtp should have metadata #28537

Open
opened 2026-04-17 19:59:16 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @bmichotte on GitHub (Mar 31, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8853

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

Is your feature request related to a problem? Please describe.

The signIn.magicLink function allows us to pass a metadata record. This is really usefull because we can add parameters like locale (which then allows us to translate the email sent).

const { error } = await authClient.signIn.magicLink({
    email,
    metadata: { locale },
})

Unfortunatelly, the signIn.emailOtp does not have this metadata table.

const { error } = await authClient.signIn.emailOtp({
    email,
    otp,
})

Describe the solution you'd like

It would be nice if those api (as well as resetPassword maybe ?) all have the metadata field

Describe alternatives you've considered

I guess it's possible to parse the ctx to retrieve the locale from the url, but...

Additional context

No response

Originally created by @bmichotte on GitHub (Mar 31, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8853 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. The `signIn.magicLink` function allows us to pass a metadata record. This is really usefull because we can add parameters like `locale` (which then allows us to translate the email sent). ```ts const { error } = await authClient.signIn.magicLink({ email, metadata: { locale }, }) ``` Unfortunatelly, the `signIn.emailOtp` does not have this metadata table. ```ts const { error } = await authClient.signIn.emailOtp({ email, otp, }) ``` ### Describe the solution you'd like It would be nice if those api (as well as resetPassword maybe ?) all have the `metadata` field ### Describe alternatives you've considered I guess it's possible to parse the `ctx` to retrieve the locale from the url, but... ### Additional context _No response_
GiteaMirror added the credentialsenhancement labels 2026-04-17 19:59:16 -05:00
Author
Owner

@ping-maxwell commented on GitHub (Mar 31, 2026):

Hey for now you should be able to do this via passing it through headers and then on the server you can get it off ctx.request im pretty sure

<!-- gh-comment-id:4162495295 --> @ping-maxwell commented on GitHub (Mar 31, 2026): Hey for now you should be able to do this via passing it through headers and then on the server you can get it off `ctx.request` im pretty sure
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28537