-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix hardcoded 'normalizedEmail' database field #33
base: main
Are you sure you want to change the base?
Conversation
Make the normalized email field name configurable via normalizedEmailField option to fix compatibility with databases that use different field names. Fixes GeKorm#31
/release:pr d01b7de |
A new release has been made for this PR. You can install the package you need using
|
Hi @kdcokenny thank you very much for both the bug report and PR! I took some time to look at how internal better-auth plugins handle this case and they seem to be leveraging the |
Sorry about the delay, thanks for pushing this so quickly. I will go over it shortly. |
When using the package as you suggested I get the following error: This is in a react-router app using bun as a package manager and ts set to ESNEXT. |
This looks like this is not your fault though. My old package I used zipped with .tgz stopped working with the same error mentioned before. Not sure why that's happening lol. |
Update: I got the issue beforehand fixed it was an issue with my Vite config. I also downloaded your package with the cmd above and used it like this: emailHarmony({
schema: {
user: {
fields: {
normalizedEmail: "normalized_email"
}
}
}
}), However whenever I put a temp email in like foo+test@gmail.com the database contents were always null. When I switched back to my pkg in this it worked properly but with the less-optimal design: emailHarmony({
normalizedEmailField: "normalized_email"
}) |
I think we'll have to do it your way then, as it might be a better-auth bug, similar to better-auth/better-auth#1414 where the mappings don't work correctly. May I ask what database and/or adapter you're using please? Asking because the tests pass on SQLite and I want to add the failing case to the test suite. |
Summary
Fixes #31
Test plan