feat: Changes account creation to support multiple steps (#8859)

* feat: Changes account creation to support multiple steps

* Adds API changes and new routes

* Fixes type
This commit is contained in:
Nithin David Thomas
2024-02-08 02:02:02 -08:00
committed by GitHub
parent 17cb938bc8
commit a649c2733f
6 changed files with 49 additions and 10 deletions
+14 -2
View File
@@ -28,8 +28,6 @@ export const login = async ({
export const register = async creds => {
try {
const response = await wootAPI.post('api/v1/accounts.json', {
account_name: creds.accountName.trim(),
user_full_name: creds.fullName.trim(),
email: creds.email,
password: creds.password,
h_captcha_client_response: creds.hCaptchaClientResponse,
@@ -42,6 +40,20 @@ export const register = async creds => {
return null;
};
export const accountSetup = async ({ id, name, locale }) => {
try {
const response = await wootAPI.put(`api/v1/accounts/${id}.json`, {
name,
locale,
});
setAuthCredentials(response);
return response.data;
} catch (error) {
throwErrorMessage(error);
}
return null;
};
export const verifyPasswordToken = async ({ confirmationToken }) => {
try {
const response = await wootAPI.post('auth/confirmation', {