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.
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). |
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. |
# 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. |
# 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. |
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. |