diff --git a/backend/routes/auth.py b/backend/routes/auth.py index ba54cc8d..950046e2 100644 --- a/backend/routes/auth.py +++ b/backend/routes/auth.py @@ -105,9 +105,10 @@ def sign_up(): password = data["password"] password_hash = hashlib.md5(password.encode()) + # Create an empty default profile default_profile = Profile( - profileName="default", + profileName=f"{data['fullName']}'s Default", skills=[], job_levels=[], locations=[], diff --git a/frontend/src/App.js b/frontend/src/App.js index 4f57ab67..efff9a47 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -191,13 +191,22 @@ export default class App extends React.Component { defaultProfile: res.data[CONSTANTS.PROFILE.DEFAULT_PROFILE], }); }) + .then(() => { + return axios.get("http://localhost:5000/getProfile", { + headers: { + userid: userId, + Authorization: `Bearer ${localStorage.getItem("token")}`, + }, + }); + }) + .then((res) => { + this.setState({ + userProfile: res.data, + currentPage: CONSTANTS.PAGES.PROFILE.NAME, + sidebar: true, + }); + }) .catch((err) => console.log(err.message)); - - this.setState({ - currentPage: CONSTANTS.PAGES.PROFILE.NAME, - sidebar: true, - userProfile: user, - }); }; // ✅ Show Logout Modal