auth.signUp and auth.signIn gives same otp every time and fail to verifyOtp

I am implementing email auth. At first I signup a user by email, and received otp, the verifyotp worked, user become verified and can login by password. then I was to test passwordless(otp) signin by email, it always give me same otp and always fail to verify otp (error says 'Token has expired or is invalid') no matter how many times I call the auth.signIn and pass in the token in verifyOtp.

I then deleted the user from supabase authentication users and want to try signup again. Then same error happens, every signup gives me same otp and fails to verify.

My implementations
// signUp
    const { data, error } = await this._client.auth.signUp({
      phone: mobile,
      password: password,
    });
// email sign in with otp
    const { data, error } = await this._client.auth.signInWithOtp({
      email: email,
      options: {
        shouldCreateUser: false,
      },
    });
// verify otp
    const { data, error } = await this._client.auth.verifyOtp({
      email: email,
      token: code,
      type: 'email',
    });
Was this page helpful?