onLogin( )


Sets the function that runs when a member logs in.

The onLogin() event handler runs when a member logs into your site.

onLogin receives a currentMember object for the logged-in member, which contains the CurrentMember methods you can use to retrieve the member's information.

Usually, you want to call onLogin() in the masterPage.js file in the code editor so that the onLogin() event handler runs no matter which page a member uses to log in.

Notes:

  • The APIs in wix-members-frontend are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

  • The APIs in wix-members-frontend can only be used once the page has loaded. Therefore, you must use them in code that is contained in or is called from the onReady() event handler or any element event handler.

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(currentMember: CurrentMember): void Function name or expression to run when a member logs in.

Was this helpful?
Yes
No