
Context: I'm implementing a custom phone number authentication flow using a third-party OTP service. I'm trying to create a session in Appwrite, but encountering an user_invalid_token error.
Current Implementation:
try { final token = await account.createPhoneToken( userId: ID.unique(), phone: phone ); final id = token.userId;
// Generating custom OTP generatedOTP = generateOTP();
// Attempting to create session await account.createSession(userId: id, secret: generatedOTP); } catch (e) { print('Error creating user: $e'); }
Additional Details:
-Using Flutter -Using a third-party OTP generation service -Getting ** AppwriteException: user_invalid_token, Invalid token passed in the request. (401)**
Recommended threads
- User Queries not working
When I try to use queries on users, it gives error saying invalid query method. Now, I dont know whether it is possible or not to query users or it’s just some...
- Email OTP Mail Getting Delayed by 10 min...
I just noticed I am reciving delayed otp emails on frankfurt server we are on free plan now but we are planning to change to get on to paid plan can anyone plea...
- Failing to run document operations on sd...
Could someone point me in the right direction I'm going in cirlces. I have a problem with sdks and my self-hosted server in production (for ~3 years) I have bee...
