# Auto login after registration

**URL:** <https://forum.wixstudio.com/t/auto-login-after-registration/20164>\
**Category:** Ask the community\
**Tags:** wix-members-area, question, code\
**Created:** [May 15, 2019, 12:31pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164 "2019-05-15T12:31:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike63762](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mike63762/32/8767_2.png) [@mike63762](https://forum.wixstudio.com/u/mike63762)\
**Post date:** [May 15, 2019, 12:31pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/1 "2019-05-15T12:31:27Z")

</div>

Hi I’m confused about the members area. When I used the wix version of the members area it seems to auto-login the user after registration. To meet my requirements I had to build my own, so I use this call in my backend code to register the user:

wixUsers.register(userObj.email, userObj.password)

After registration I was expecting the user to be logged in, but they are not. What is the correct approach to have the user get to a logged inn state ?

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [May 15, 2019, 12:34pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/2 "2019-05-15T12:34:56Z")

</div>

No, that will all depend on how you set up your original approval setting, which was probably set as automatically approve as default.  
[https://support.wix.com/en/article/editing-your-member-signup-settings-for-the-default-form](https://support.wix.com/en/article/editing-your-member-signup-settings-for-the-default-form)

Edit the general member settings:

**Who can be a member?**

Choose who can be a member of your site:

**Everyone:** When a new member signs up, they are approved automatically. You do not need to do anything.

**People I approve:** When a new member signs up, you receive a notification, both by email and in your site’s dashboard, asking if you want to approve or reject them. Only those who you approve become site members.

You can make a custom signup form through Wix Forms:  
[https://support.wix.com/en/article/creating-a-custom-signup-form-for-your-members-area](https://support.wix.com/en/article/creating-a-custom-signup-form-for-your-members-area)

Or you can create your own custom login and signup lightboxes instead, however if you do this option, then you will need to edit your signup settings as this:  
[https://support.wix.com/en/article/corvid-enabling-custom-site-registration](https://support.wix.com/en/article/corvid-enabling-custom-site-registration)

Have a read of the apis here for the code options  
[https://www.wix.com/corvid/reference/wix-users.html#register](https://www.wix.com/corvid/reference/wix-users.html#register)  
[https://www.wix.com/corvid/reference/wix-users-backend.html#register](https://www.wix.com/corvid/reference/wix-users-backend.html#register)

---

<div class="post-metadata">

**Author:** ![mike63762](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mike63762/32/8767_2.png) [@mike63762](https://forum.wixstudio.com/u/mike63762)\
**Post date:** [May 15, 2019, 12:50pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/3 "2019-05-15T12:50:48Z")

</div>

I’m not using the wix members area, so this doesn’t apply. I have the approval set to approve everyone.

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [May 15, 2019, 1:00pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/4 "2019-05-15T13:00:43Z")

</div>

I know that you are not, however you need to setup your custom signup settings if using your own custom login/signup lightboxes:  
[https://support.wix.com/en/article/corvid-enabling-custom-site-registration](https://support.wix.com/en/article/corvid-enabling-custom-site-registration)

Then use this on your code from the api:  
[https://www.wix.com/corvid/reference/wix-users.html#register](https://www.wix.com/corvid/reference/wix-users.html#register)  
[https://www.wix.com/corvid/reference/wix-users-backend.html#register](https://www.wix.com/corvid/reference/wix-users-backend.html#register)

---

<div class="post-metadata">

**Author:** ![Shan](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shan/32/106059_2.png) [@Shan](https://forum.wixstudio.com/u/Shan)\
**Post date:** [May 15, 2019, 2:03pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/5 "2019-05-15T14:03:54Z")

</div>

Hi,

To login a user after registration you need to run the registration code client side, which means on the page itself using [wix-users API](https://www.wix.com/corvid/reference/wix-users.html#register)

If you register the user using the [register function from wix-users-backend](https://www.wix.com/corvid/reference/wix-users-backend.html#register) then it means you are registering them server-side which will not do anything on the page.

---

<div class="post-metadata">

**Author:** ![mike63762](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mike63762/32/8767_2.png) [@mike63762](https://forum.wixstudio.com/u/mike63762)\
**Post date:** [May 15, 2019, 2:05pm UTC](https://forum.wixstudio.com/t/auto-login-after-registration/20164/6 "2019-05-15T14:05:56Z")

</div>

Perfect! Thanks
