I’m trying to set up a way to create a new user from within the site. I don’t want them to have to logout, then log back in for it to be done.
Question: What for do you need this functionality? Who will use this function & why?
Why for example an already registered and logged-in user (member) should create a further member-acoount?
Or is it you as ADMIN → who wants to create members from within your site (page) ?
Reading just this sentence…
I’m trying to set up a way to create a new user from within the site.<
I understand, that this function is wanted from the view of an ADMIN.
But reading the next sentence →
I don’t want them to have to logout, then log back in for it to be done.
…confuses again.
So what is your exact goal? Please describe a bit more in detail and explain what for you need this?
Futher, pay attention, that working just on FRONTEND → you will face → RESCTRICTIONS (security-reason). As i can see, your code is a FRONT-END-CODE → that means you may not have the rights, you normaly would get/have on BACKEND.
So instead of using FRONTEND-API → you may better try to generate a BACKEND-CODE.
There are only 2 APIS which would help you as of my knowledge…
Wix-Members-Backend-API
Wix-CRM-BackendAPI
In this both APIs also APIs like LOGIN/LOGOUT (AUTHENTICATION) should be included, as i can remember.
Thanks for the message and further info. Sorry about the late reply.
I managed to get this working. I put it in the backend, but it also needed “elevated permissions” to work.
The functionality is for agencies. I want them to have a master login, and then be able to add new accounts for each client they onboard. This way, they can see a list of accounts linked to the master account and switch between them easily.