auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

verifyOtp() email parameter is Case Sensitive

Open hjaber opened this issue 3 years ago • 0 comments

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

hjaber avatar Sep 09 '22 18:09 hjaber