Module

Login

A login form page for user authentication.

This page provides a user interface for users to log in, request password changes, and verify their identity using OTP.

View Source pages/Authentication/Login/LoginForm.jsx, line 16

Methods

# inner handleGetOtp(values)

Handle the process of getting and sending an OTP for verification.

This function determines whether to send the OTP to a phone number or an email address based on the isEmailVerify state.

Parameters:
Name Type Description
values Object

The input values containing either a new phone number or a new email address.

new_phone string

The new phone number to verify (if not using email).

new_email string

The new email address to verify (if not using phone).

View Source pages/Authentication/Login/LoginForm.jsx, line 97

If there's an issue with sending the OTP or setting the OTP modal.

Error

# inner handleOtpSubmit(event)

Handle OTP submission and verification.

Parameters:
Name Type Description
event Object

The form submit event.

View Source pages/Authentication/Login/LoginForm.jsx, line 245

# inner handleSignIn(event)

Handle user sign-in.

This function is called when the user submits the login form. It sends a request to authenticate the user and manages the subsequent actions based on the response.

Parameters:
Name Type Description
event Object

The form submit event.

View Source pages/Authentication/Login/LoginForm.jsx, line 200

# inner validateConfirmPassword(options) → {Object}

Custom validation rule for confirming a new password.

This function checks if the value of the confirm password field matches the value of the new password field.

Parameters:
Name Type Description
options Object

Validation options.

getFieldValue function

Function to get the value of other form fields.

View Source pages/Authentication/Login/LoginForm.jsx, line 181

A validation object with resolved promise if the passwords match, or a rejection with an error message if they don't match.

Object

# inner validatePassword(rule, value, callback)

Validate the password format.

Parameters:
Name Type Description
rule Object

The validation rule.

value string

The password value to validate.

callback function

The callback function for validation.

View Source pages/Authentication/Login/LoginForm.jsx, line 66