# Simple Log In Page!


**URL:** <https://forum.wixstudio.com/t/simple-log-in-page/38128>\
**Category:** Ask the community\
**Tags:** question, code, design\
**Created:** [November 6, 2019, 12:52pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128 "2019-11-06T12:52:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 6, 2019, 12:52pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/1 "2019-11-06T12:52:57Z")

</div>

I am trying to design a simple log in system for my cousin’s website. Can you provide me with any code for this page please? I attach a screen shot of page:

 ![](https://us1.discourse-cdn.com/wix/original/3X/7/6/762e1c539d51be13814c056ea0269a7e124f4c23.jpeg)

---

<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:** [November 6, 2019, 1:17pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/2 "2019-11-06T13:17:43Z")

</div>

Just follow Nayeli (Code Queen) excellent examples here and you can’t go wrong.

Register  
[https://www.totallycodable.com/wix/corvid/custom-registration-for-site-login-using-wix-code](https://www.totallycodable.com/wix/corvid/custom-registration-for-site-login-using-wix-code)  
[https://www.youtube.com/watch?v=QbH8\_eudjbE](https://www.youtube.com/watch?v=QbH8_eudjbE)

Login  
[https://www.totallycodable.com/wix/corvid/create-custom-log-in-sign-on-screen-using-wix-code](https://www.totallycodable.com/wix/corvid/create-custom-log-in-sign-on-screen-using-wix-code)

Just remember to change your own signup settings for Corvid now.  
[https://support.wix.com/en/article/corvid-enabling-custom-site-registration](https://support.wix.com/en/article/corvid-enabling-custom-site-registration)

You can also use the Wix Members app  
[https://support.wix.com/en/site-members/setting-up-a-members-area](https://support.wix.com/en/site-members/setting-up-a-members-area)

Plus, create your own member profile pages too.  
[https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area](https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area)

Read here for the three different methods of signup and login for Wix  
[https://support.wix.com/en/article/about-the-member-signup-form](https://support.wix.com/en/article/about-the-member-signup-form)

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 7, 2019, 1:23am UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/3 "2019-11-07T01:23:25Z")

</div>

Thanks for the reply. This is the code I have for the above login page, but there is an error down at the bottom of the code that I can’t figure out:

 ![](https://us1.discourse-cdn.com/wix/original/3X/6/8/68d33c330711c00dee42dea424510c3830903835.gif)

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 7, 2019, 11:55am UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/4 "2019-11-07T11:55:00Z")

</div>

I am having some trouble with the following linn of code:

$w(“#errorMessage”).expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to ‘collapse on load’ from the Properties Panel.

Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![code-queen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-queen/32/696_2.png) [@code-queen](https://forum.wixstudio.com/u/code-queen)\
**Post date:** [November 7, 2019, 12:42pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/5 "2019-11-07T12:42:59Z")

</div>

As the line says, if you are not going to use an error meseage then delete that line of code.

According to your screenshot, you did not add extra text element to display any possible error. So the code will mark it red because either the element does not exist on the page or the element was not detected by that name.

---

<div class="post-metadata">

**Author:** ![code-queen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-queen/32/696_2.png) [@code-queen](https://forum.wixstudio.com/u/code-queen)\
**Post date:** [November 7, 2019, 12:43pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/6 "2019-11-07T12:43:29Z")

</div>

@givemeawhisky:heart:

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 7, 2019, 12:49pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/7 "2019-11-07T12:49:40Z")

</div>

Do you have an example of the extra text element?

---

<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:** [November 7, 2019, 5:06pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/8 "2019-11-07T17:06:28Z")

</div>

It is already shown in Nayeli’s example for the signup tutorial, it is the pink text underneath the submit button that reads ‘Oops! Check your info and try again.’

If you are wanting to use it then just simply put a text element on your page with your error message in it.  
Call it errorMessage as the elements ID name and you won’t need to change the code example, plus don’t forget to set that text element as collapsed on load through the properties panel for it.

Otherwise, as Nayeli says already, just take it out if you don’t need that line.

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 15, 2019, 10:11pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/9 "2019-11-15T22:11:56Z")

</div>

Further to my query, I have made 2 additions to my layout. See screenshot:

This is the code I am using:

This what the member’s login page looks like:

However when I fill out the email and password to login I get a page error:

Can anyone give me some guidance? Thanks!

---

<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:** [November 15, 2019, 11:04pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/10 "2019-11-15T23:04:25Z")

</div>

You shouldn’t just copy and paste and assume that everything will work correctly, you do actually have to know what is going on too. 😉

As for your error, have you got the Wix Members app installed in your website?  
[https://support.wix.com/en/article/adding-a-members-area-to-your-site](https://support.wix.com/en/article/adding-a-members-area-to-your-site)

As currently the line of code in your login lightbox here:

```javascript
wixLocation.to("/account/my-account");

```

Is redirecting the now logged in site members to their own My Account through the Wix Members app, which is the page shown in the Wix Members app link above.

Everything that is done through the Wix Members app pages will have the prefix of /account/your-page-name, so for yours it would be yourwebsite/account/my-account.

When you add the Wix Members app to your website, it automatically adds the Wix Members/PrivateMembersData collection.  
[Velo: Wix Members "PrivateMembersData" Collection Fields | Help Center | Wix.com](https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields)

As you are trying to redirect your site members to the My Account page, as you don’t have the Wix Members app installed, it will instead try to redirect you to your own data through this Members collection, as you can see in address bar in your error picture and hence why you get the 403 error message.

If you want to redirect the logged in member to another page then simply change that page url to whatever page you want the member to go to, for example:

```javascript
wixLocation.to(wixLocation.url); //This reloads the same page
//or//
wixLocation.to(`/members-area`);  

```

If you do this tutorial for Wix Member Profile pages, then you will see that all the pages for these dynamic pages are having the prefix of yourwebsite/members/{userID}, although the userID can be changed to another variable if you want it to be different.  
[Velo Tutorial: Building Your Own Members Area | Help Center | Wix.com](https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area)

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 15, 2019, 11:56pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/11 "2019-11-15T23:56:31Z")

</div>

Thanks for the reply. I think I follow your lead and will look at the wix location

---

<div class="post-metadata">

**Author:** ![info48123](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/info48123/32/15917_2.png) [@info48123](https://forum.wixstudio.com/u/info48123)\
**Post date:** [November 18, 2019, 3:16am UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/12 "2019-11-18T03:16:27Z")

</div>

[![](https://us1.discourse-cdn.com/wix/original/3X/7/d/7d71a8dd4e421ac01376bbbce00b6e67f0a136e6.jpeg "How To Create A Custom Log In Wix - Login Lightbox Tutorial - The Non Coding Founder's Guide") ](https://www.youtube.com/watch?v=9eGhGfCiAbo)

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 18, 2019, 10:46am UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/13 "2019-11-18T10:46:14Z")

</div>

Hi Michael. I made a small bit of progress. However when I enter login details, I get another login page instead:

I stil must have an error in the code.

Here is my amended code:

**import** wixUsers **from** ‘wix-users’;  
**import** wixLocation **from** ‘wix-location’;  
**import** wixWindow **from** ‘wix-window’;

$w.onReady( **function** () {  
$w(“#forgotPassword”).onClick( (event) =\> {  
[//wixWindow.lightbox.close](https://wixWindow.lightbox.close)()  
wixUsers.promptForgotPassword()  
.then( ( ) =\> {  
//  
} )  
. **catch** ( (err) =\> {  
**let** errorMsg = err; //“The user closed the forgot password dialog”  
});  
});  
});

export function loginButton\_click(event) {

**let** email = $w(“#email”).value;  
**let** password = $w(“#password”).value;

wixUsers.login(email, password)  
.then( () =\> {  
console.log(“User is logged in”);  
wixLocation.to(“/member-s-content”); //Change the URL ending to whatever page you want to send the user to after they log in.  
} )  
. **catch** ( (err) =\> {  
console.log(err);  
$w(“#errorMessage”).expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to ‘collapse on load’ from the Properties Panel.  
} );  
}

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [November 18, 2019, 11:59am UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/14 "2019-11-18T11:59:51Z")

</div>

I  
The only problem I have with the above code is that when I enter my login details and click the login button on my own custom login page, the wix login page appears. Instead I want the members tologin sucessfully to my member’s content page or get an error message saying login was not suuccessful.  
made a small bit of progress. Please see 2 screenshots below:

I stil must have an error in the code.

Here is my amended code:

**import** wixUsers **from** ‘wix-users’;  
**import** wixLocation **from** ‘wix-location’;  
**import** wixWindow **from** ‘wix-window’;  
$w.onReady( **function** () {  
$w(“#forgotPassword”).onClick( (event) =\> {  
[//wixWindow.lightbox.close](https://wixWindow.lightbox.close)()  
wixUsers.promptForgotPassword()  
.then( ( ) =\> {  
//  
} )  
. **catch** ( (err) =\> {  
**let** errorMsg = err; //“The user closed the forgot password dialog”  
});  
});  
});  
export function loginButton\_click(event) {  
**let** email = $w(“#email”).value;  
**let** password = $w(“#password”).value;  
wixUsers.login(email, password)  
.then( () =\> {  
console.log(“User is logged in”);  
wixLocation.to(“/member-s-content”); //Change the URL ending to whatever page you want to send the user to after they log in.  
} )  
. **catch** ( (err) =\> {  
console.log(err);  
$w(“#errorMessage”).expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to ‘collapse on load’ from the Properties Panel.  
} );  
}

---

<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:** [November 18, 2019, 12:40pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/15 "2019-11-18T12:40:14Z")

</div>

Yes when you change from the Wix default window to Corvid, you also need to change your member signup settings to suit your different choice too.  
[https://support.wix.com/en/article/corvid-enabling-custom-site-registration](https://support.wix.com/en/article/corvid-enabling-custom-site-registration)

---

<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:** [December 2, 2019, 7:47pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/16 "2019-12-02T19:47:42Z")

</div>

Hi Michael,

If you have the chance, could you please check this post out too as they are using your code for Wix Stores reviews.  
[https://www.wix.com/corvid/forum/community-discussion/product-review-issues](https://www.wix.com/corvid/forum/community-discussion/product-review-issues)

Tried linking you to the actual forum post through @Michael Patrick Strauch (MPS), however it wouldn’t let me do it.

---

<div class="post-metadata">

**Author:** ![code-queen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-queen/32/696_2.png) [@code-queen](https://forum.wixstudio.com/u/code-queen)\
**Post date:** [December 2, 2019, 7:51pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/17 "2019-12-02T19:51:23Z")

</div>

@givemeawhisky He does not have an error in his code, per say. He is building this on a Page instead of a Lightbox. Therefore he needs to redirect his login lightbox (selected via the custom wix settings) to auto-redirect to the Page instead. He has been given the copies of the codes, Article and API reference (via this forum and the FB group). He is still unable to understand the process. I advised him it would be better to get private assistance from someone to walk him through the steps if he sill does not understand how to put it all together.

---

<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:** [December 2, 2019, 9:25pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/18 "2019-12-02T21:25:12Z")

</div>

@code-queen

Yes, simply move the login parts to a lightbox and job is easily sorted and done. Or, as said above, have a blank lightbox which will automatically redirect to this login page in the lightboxes onReady function, there shouldn’t be hardly any delay for this latter option.

Plus, we do listen honestly, we know women are always right, well that is what my wife and the mother-in-law keeps telling me 😉

---

<div class="post-metadata">

**Author:** ![niallmagner](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/niallmagner/32/15661_2.png) [@niallmagner](https://forum.wixstudio.com/u/niallmagner)\
**Post date:** [December 2, 2019, 11:10pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/19 "2019-12-02T23:10:40Z")

</div>

I am sure it is staring me right in the face but I just can’t see it

---

<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:** [December 2, 2019, 11:27pm UTC](https://forum.wixstudio.com/t/simple-log-in-page/38128/20 "2019-12-02T23:27:42Z")

</div>

As already stated, simply move this page to a lightbox along with the code and job is easily sorted and done.

Or, as said above, have a blank lightbox which will automatically redirect to another page in the lightboxes onReady function, there shouldn’t be hardly any delay for this latter option.

Something like this on your blank lightbox page.

```javascript
$w.onReady( () => {
wixLocation.to(`/yourpageurlhere`);
});

```

However, you should really have just done the login and the signup process within a lightbox as the Wix Support pages tell you when talking about doing custom login and signup.

> **[About the Member Signup Form | Help Center | Wix.com](https://support.wix.com/en/article/about-the-member-signup-form#corvid-form)**
>
> The member signup form is part of the Members Area on your site. It lets your visitors register to become members of your site. There are 3 types of member sign

Plus, hence the reason why you can only connect your member signup settings to a lightbox when you use the Wix Corvid option in the settings itself.

> **[Velo: Enabling Custom Site Registration | Help Center | Wix.com](https://support.wix.com/en/article/velo-enabling-custom-site-registration)**
>
> Visit the Velo by Wix website to onboard and continue learning.Velo allows you to create a custom site registration form using code.  After creating a custom si

To enable custom site registration:

- Add a lightbox to your site.

- Create a custom registration form in the lightbox using Corvid.

- Enable custom signup settings:

- Click Menus & Pages on the left side of the Editor.

- Click Member Signup.

- Click Member Signup Form.

- Click the drop-down menu and select Corvid Form.

- Select your form from the What does it link to? drop-down menu.

[Next page](https://forum.wixstudio.com/t/simple-log-in-page/38128.md?page=2)
