Hi all,
I have created standard wix login before on another site, and also done this from backend. On my current site, it is a little different.
We collect data elsewhere through registration and place this in a dataset of Vendors (this includes “username” and “password”. This is a regular dataset of Vendor items.
I want to create a custom login for my Vendors. I don’t want them to sign up privately. Our agents have already signed them up.
The username and password is already on the Vendors dataset, all I want to create is a login page for my Vendors to be able to access certain data linked to their “Vendor profiles”.
How can I create a custom login using the username and password sitting in the Vendor Dataset?
Currently: I don’t have them “wixUsers.registered”. I’ve seen this elsewhere but wondering can I create a login access without a user being a “wixUser”?
Alternatively: How can I register them on Wix without them having to submit in sign up ?
NB: I cannot have them submit the signup form on their own accord for our unique business reasons.
To be able to use the members API for security and ease you will definitely want to be able to register your users.
I am thinking there may be a way by creating a custom login (with no signup) and then checking against your vendors collection and using register()
Something like user enters credentials → try login() → if login fails → use the Data API and query Vendors collection → if exists, use register() to create a new site member/login automatically-> if both fail, the user is not a site member or a vendor → give error message
I can’t think through the whole workflow right now - end of the day for me, but take a look at the API and see what you think.
If my email and password are sitting in the Vendors dataset, how exactly does “authentication” work with that dataset in this example? I’m not quite seeing how I am going to connect a new (registered) user to the Vendors dataset which has the username and password.
I am not using email, it is a unique username identifier. Will username work instead of email?
@kscholiadis if you’re not using an email.
There are 2 different approaches you can take.
They won’t be system member but custom members of your own. Meaning: you’ll ask them to fill-in user identifier and password, check it against the Vendors database and if they’re in, proceed as you like (you won’t be able to use the system permissions though as they’re not members and you’ll have to create permission logic of your own). You also won’t be able to use the Wix members area.
Take the identifier they type in, and create a fake corresponding email address. Let’s say, the identifier is ‘vendorA5’ then the fake email can be ‘vendorA5@mysite.vendor’; By adding the ‘@mysite.vendor’ to the user input behind the scene, you can register and log the user in.
In both options, you’ll have to use a custom login form.
Thank you for the above explanation. With Point 2, are you saying that by doing this, the vendor will be regarded as a Wix Member who is logged in? As opposed to a custom logged in member?