You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Registers a user without a password and sends a verification code via email.
112
+
-**Parameters:**
113
+
-`email` (`str`): User's email address.
114
+
-`custom_data` (`any`, optional): Additional user info to store. If None, defaults to an empty dictionary.
115
+
106
116
-**verify_user(email, code)**
107
117
- Verifies a user by checking the provided verification code.
108
118
-**Parameters:**
@@ -116,6 +126,19 @@ All functions return a dictionary: `{"success": True/False, "message": "specific
116
126
-**Parameters:**
117
127
-`email` (`str`): User's email address.
118
128
-`password` (`str`): User's password.
129
+
-`mfa` (`bool`, optional): If set to `True`, it will send the user a six-digit code to their email for multi-factor authentication. Defaults to `False`.
130
+
-
131
+
-**verify_mfa_code(email, code)**
132
+
- Verifies the multi-factor authentication code sent to the user's email. Can be used in conjunction with register_user_no_pass(), verify_user(), and generate_code() for passwordless sign-in.
133
+
-**Parameters:**
134
+
-`email` (`str`): User's email address.
135
+
-`code` (`str`): Six-digit code sent to the user's email.
136
+
137
+
### MFA Code Management
138
+
-**generate_code(email)**
139
+
- Generates and emails a code to the user. Call before password and email resets or when signing in without password.
140
+
-**Parameters:**
141
+
-`email` (`str`): User's email address.
119
142
120
143
### Password Management
121
144
@@ -126,11 +149,6 @@ All functions return a dictionary: `{"success": True/False, "message": "specific
126
149
-`old_password` (`str`): User's current password.
127
150
-`new_password` (`str`): New password to set.
128
151
129
-
-**generate_reset_code(email)**
130
-
- Generates and emails a password reset code to the user.
- Changes the user's email address after verifying a reset code sent to their email. Optionally verifies the password.
169
+
- Changes the user's email address after verifying a reset code sent to their email. Optionally uses password verification if the user has a saved password or one is provided.
152
170
-**Parameters:**
153
171
-`email` (`str`): User's current email address.
154
172
-`reset_code` (`str`): Reset code sent to the user's email.
@@ -188,14 +206,20 @@ When a user is blocked, they cannot log in or perform any actions that require a
188
206
### Custom User Data
189
207
Custom user data is a flexible field that can store any type of data. It is stored alongside the normal user data.
190
208
Store all custom data in a dictionary format for more storage and to use the 2nd and 4th functions in the section below.
209
+
If the method is meant to return data, it will do so in the following format:
210
+
211
+
{
212
+
"success": True/False,
213
+
"message": "Custom user data if success OR error code if failure"
214
+
}
191
215
192
216
-**get_cust_usr_data(email)**
193
-
-Retrieves all custom user data for the user.
217
+
-Returns all custom user data for the user.
194
218
-**Parameters:**
195
219
-`email` (`str`): User's email address.
196
220
197
221
-**get_some_cust_usr_data(email, field)**
198
-
-Retrieves a specific dictionary entry from the user's custom data. REQUIRES the custom data to be stored in a dictionary format.
222
+
-Returns a specific dictionary entry from the user's custom data. REQUIRES the custom data to be stored in a dictionary format.
0 commit comments