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:
wix-members-frontend
are only partially functional when previewing your site.
View a published version of your site to see their complete functionality.function login(email: string, password: string): Promise<void>;
Login email address.
Member password.
import { authentication } from "wix-members-frontend";
// ...
authentication
.login(email, password)
.then(() => {
console.log("Member is logged in");
})
.catch((error) => {
console.error(error);
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.