Skip to content
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

Never received any otp code, response is null on session and error #2676

Open
voyagebagage opened this issue Apr 23, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@voyagebagage
Copy link

voyagebagage commented Apr 23, 2024

Describe the bug
I Never received any otp code, response is null on session and error, also it gives me an isLoading to true

To Reproduce
I use Native, so an iOs simulator and when I signIn with otp with
https://docs.nhost.io/guides/auth/sign-in-phone-number#other-sms-providers

I get a response with

{
  "error": null,
  "mfa": null,
  "session": null
}

when I do it in the browser it throw an error:

SignIn error: The state machine is not yet ready after 15 seconds.

all my SIDs are in the Nhost platform, should I get something going within Twilio ?

Expected behavior
To have a session not null and receive an SMS

Screenshots
and nothing in the network , this is on the browser

Capture d’écran 2024-04-23 à 16 48 45

this is on the simulator

Capture d’écran 2024-04-23 à 16 49 53
 const [stage, setStage] = React.useState<String>('');
  const signIn = async () => {
    console.log('Signing in');
    try {
      const response = await nhost.auth.signIn({
        phoneNumber: '+3XXXXXXXXX',
      });
     
      console.log(JSON.stringify(response, null, 2));
  
      const { session, error } = response;
      if (session) {
        setStage('otp');
      }
   
    } catch (error) {
      console.log('SignIn error:', error);
    }
  };

  return (
    <YStack backgroundColor="white" minHeight="100%">
      <Image source={require('../../assets/phangan.jpeg')} style={styles.logo} resizeMode="cover" />
      <H1 color={'black'} alignSelf="center">
        Today
      </H1>
      {stage !== 'otp' ? (
        <View style={styles.container}>
          <CustomButton onPress={signIn} bgColor="#3B71F3" fgColor="white" text="Sign In" />
        </View>
      ) : (
        <OtpInput
          numberOfDigits={6}
          autoFocus
          onTextChange={(code) => {
            console.log('code:', code);
          }}
          onFilled={async (code) => {
            await nhost.auth.signIn({
              phoneNumber: '+3XXXXXXXX',
              otp: code,
            });
          }}
        />
      )}
    </YStack>
  );
};

Desktop (please complete the following information):

  • mac os 13.3.1
  • Chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Simulator iphone14
  • OS: 16.4

Additional context
it creates an user in the DB....

@voyagebagage voyagebagage added the bug Something isn't working label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant