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
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...
- change role of a team member in Appwrite
It's not possible to add/change roles of a team meber in Appwrite Frontend. When you click on a member of a team you get forwarded to the configuration page of ...
- Deeplinking/hosting apple-app-site-assoc...
I'm trying to implement deeplinking so that after a user logs in, they are redirected to the place in my app I want them to go. As far as I understand, I need a...