I have created an app using react native and am trying to figure out a way to use the wix users api to log in a member. Not sure if this is possible. I want it to be secure. I know about wix http functions and will utilize them once a user is logged in. Not sure if I need to use http or something else to accomplish this.
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
You can authenticate the login using the login() function from the Wix Users Backend API but how you will manage the logged in session on your mobile app is up to you.
import wixUsers from 'wix-users-backend'; export function myBackendFunction(email, password) { return wixUsers.login(email, password) .then( (sessionToken) => { return {sessionToken, "approved": true}; } ) .catch( (error) => { return {"approved": false, "reason": error}; } ); }
Expose your site's api to run the above function when a post request is made and return the session token or error code when your mobile app makes a post request to it.
Make sure to have the user registered on the site beforehand (preferably using the register function)