login( )


Logs a registered member in with an email and password.

The login() function returns a Promise that resolves when the member with the specified email address and password is logged in.

The login() function only works with existing members. To register a new member use the register() function.

Note:

  • 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.
Method Declaration
Copy
function login(email: string, password: string): Promise<void>;
Method Parameters
emailstringRequired

Login email address.


passwordstringRequired

Member password.

JavaScript
import { authentication } from "wix-members-frontend"; // ... authentication .login(email, password) .then(() => { console.log("Member is logged in"); }) .catch((error) => { console.error(error); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?