Broke-Brokers / Broke_BRokers-soen341projectF2023

This is the github for everything about the SOEN341 real estate project of the Broke Brokers team
0 stars 0 forks source link

TASK - 0.5.1 Implement User Registration with Extended Profile Information #241

Open taylcr opened 1 year ago

taylcr commented 1 year ago

from: #227 #68

TASK DESCRIPTION

As a developer, I want to implement a user registration feature that not only authenticates users but also captures and stores extended profile information in Firestore, so that we can have a richer user profile for personalized experiences.

ACCEPTANCE CRITERIA

taylcr commented 1 year ago

The switch was necessary for security and simplicity reasons as we talked in the meeting

taylcr commented 1 year ago

Done with this part, it worked

taylcr commented 1 year ago

I also made a function to keep in track the so say if a user has successfully logged in

const register = async () => { try { const userCredential = await createUserWithEmailAndPassword(auth, email, password); const additionalInfo = { surname, name, userType }; await createUserProfile(userCredential, additionalInfo); handleLogin(userType); // Call handleLogin with the correct user type setSuccess("Successfully signed up! Redirecting to home page..."); setError(""); navigateToHome(); } catch (err) { setError(err.message); setSuccess(""); } };

taylcr commented 1 year ago

The same function above also redirect the user to the main page after login :

image