I followed these links and managed to clone and translate the components for login, signup form etc.
2 - My current problem: login with mobile phone instead of login with email
I want to give my users the choice to login using their mobile phone number, since there is a lot of people that does not have email but have a mobile.
Do I have to clone and adapt the User Service Module ? If so, where is the code ?
I found this one but I believe it is not the full code.
I know the users service takes a field called “email” to be the username, but it doesn’t have to be an email address. I often use a non-email username. The only time it becomes a problem is when you want to use the built in “forgotten password” functionality, as it will attempt to send an email to whatever is in that field. So you could use their mobile number as the “email” (username), but you’ll have to implement a lot of the other functionality of the users service yourself.
Not sure if that helps any - it is Christmas Eve-Eve after all.
Yes, you are right. In this case I “could” use the email field and store the mobile number but I would also have to implement a different “forgot password” strategy, like send an SMS to the user.
I tried to locate the source code of anvil.users, but could not find it in github… if I could edit it, I believe I could adapt all these things.
Unfortunately, it is very likely that it is not possible with built-in anvil feature. You can integrate third party service (firebase, for example). But it will be costly
Hi there @CristianaSP, welcome aboard! Perhaps one of our latest Advent Calendar apps might help you out here - it explains how to integrate the external service Nexmo to deal with SMS to users. And here’s another app with SMS to look at for inspiration.
I’m not sure about the current pricing of Nexmo for what you would like to do, but they do offer a free trial. So you could give this a go and see if it matches what you want. Hope this helps!