
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
- Show execution status 500 unable to set ...
I want to set the labels at the time user signup to my application , all things work , users data save in auth, updateprefs set , a verification email sent , bu...
- Multi-tenant setup with different passwo...
Iβm building a multi-tenant SaaS app using a single project. Each tenantβs data is stored in a separate Database (one DB per tenant). Iβm using Auth for us...
- Failing to get user account after login ...
Running the attached integration test on Windows platform I get the following error. Any idea of what I'm doing wrong ? π Starting... 01:22 +0: Appwrite Authe...
