Hello, I am using phone authentication for my project. I am sending the code using createPhoneToken and verify the code with updatePhoneSession. It verifies correctly when there is only one user in the database but after the first user is verified, the second user still gets the SMS code but the verification code cannot be verified. Here is my code, could you please indicate what I am doing wrong. Thank you for your help.
Future<String> sendPhoneVerificationCode(String phone) async { try { final token = await _account.createPhoneToken( userId: ID.unique(), phone: phone, ); return token.userId; } catch (e) { rethrow; } }
Future<models.Session> verifyPhoneCode(String userId, String code) async { try { final session = await _account.updatePhoneSession( userId: userId, secret: code, ); return session; } catch (e) { rethrow; } }
Recommended threads
- Cant configure email templates
i configure it on the console, and when i send the OTP, it sends with appwrite's email (instead of custom smtp) and with the branding, but i have the Pro (educa...
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...