This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Logs in a registered member with an email and password.
The login()
function only works with existing members. To register a new member use the register()
function.
To complete the login, the returned session token must be applied using the applySessionToken()
function in the wix-members-frontend API.
function login(
email: string,
password: string,
options: LoginOptions,
): Promise<LoginResponse>;
Login email address.
Member password.
Options for logging in a member.
import { authentication } from "wix-members.v2";
async function login(email, password, options) {
try {
const result = await authentication.login(email, password, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.