I was wondering if it was possible to create a login system using a webservice as I need to add a login system in my app in Smartface App Studio?
Thanks
I was wondering if it was possible to create a login system using a webservice as I need to add a login system in my app in Smartface App Studio?
Thanks
Yes, it's possible.
One of the possible solutions is to get the user's information from a server and compare the password that the user typed and the one that came from the server, if it's equal, log in. I personally use Firebase as my server, so I save user's object name as his email, so every time I want to get this user's object, I make a GET request with his email in the URL.
Eg.
Hope that helps! :)
EDIT
Put this code somewhere in global scope (in an empty space) and when you want the user to login, use
firebase.login(someEmail, somePassword, callback)
, where callback is a function that you want to run when the login is finished. And when you want to register a user, usefirebase.register(someEmail, somePassword, callback)
.OBS. Just remember to change the auth value in Firebase rules.