Skip to content

Commit

Permalink
websocket url changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ALOK9442 committed Jan 11, 2024
1 parent 69d1ed9 commit fdf911d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/components/authcomponents/signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function SignUp() {
if(error.response.data.message[0] === "User with this email already exists") {
setError(error.response.data.message[0])
}
else {
setError("Something went wrong. Please try again.");
}
}
console.log(error);
}
Expand Down
45 changes: 31 additions & 14 deletions src/services/auth/authservice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,40 @@ export const userLogin = async (email, password) => {
}
}

export const signUpUser = async (email, password) => {
export const signUpUser = async ( email, password ) => {
try {
console.log("trying to signUp");
const response = await axios.post(BASEURL + config.signUpLink,
{ "email": email, "password": password },
{
headers: {
'Content-Type': 'application/json',
},
}
);
return response;
console.log(`Began Sign Up Process For ${email} ${password}`);

const response = await axios.post(
BASEURL+ config.signUpLink,
{
"email": email,
"password": password
},
{
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
}
);

const output = response.data;
output.statusCode = response.status;

console.log(output);
return output;
} catch (error) {
console.log(error)
throw (error)
if (axios.isAxiosError(error)) {
// Axios error
console.log(error.response?.data || error.message);
return error.response?.data || error.message;
} else if (error instanceof Error) {
// Other types of errors
console.log(error.message);
return error.message;
}
}
}
};

export const sendEmailOtp = async (email) => {
try {
Expand Down

0 comments on commit fdf911d

Please sign in to comment.