auth-js
auth-js copied to clipboard
verifyOtp() email parameter is Case Sensitive
Bug report
When signing in with email and a one time password, the email parameter is case sensitive or login will fail.
const { data, error } = await supabase.auth.verifyOtp({
email, /* case sensitive */
token,
type: 'magiclink',
})
When signing in with email and password, the email paramater is case insensitive.
const { data, error } = await supabase.auth.signInWithPassword({
email: '[email protected]', /* case insensitive */
password: 'example-password',
})
Describe the bug
Logging on with [email protected] or [email protected] both work with signInWithPassword but not with verifyOtp.
Expected behavior
Both login methods should treat email as case insensitive.
System information
- macOS Catalina v10.15.7
- Breave v1.43.89
- supabase-js: v2.0.0-rc.10
- Node.js: v16.13.0
Additional context
Using javascript email.toLowerCase() for simple fix but behavior should be consistent among both sign in methods to prevent bugs in future