@@ -331,18 +352,33 @@ function App() {
Upgrade to Premium
)}
+
+ {/* LOGOUT BUTTON */}
+
+ {/* SHOW WARNING MODAL IF needed */}
+ {showLogoutWarning && (
+
+ )}
>
)}
- {/* Main Content */}
+ {/* MAIN CONTENT */}
{/* Default to /signin */}
@@ -358,22 +394,22 @@ function App() {
/>
}
/>
- } />
+ }
+ />
} />
{/* Authenticated routes */}
{isAuthenticated && (
<>
- } />
+ }/>
} />
} />
} />
} />
} />
- }
- />
+ } />
} />
{/* Premium-only routes */}
diff --git a/src/components/SignIn.js b/src/components/SignIn.js
index f68aa4e..ebde410 100644
--- a/src/components/SignIn.js
+++ b/src/components/SignIn.js
@@ -55,21 +55,8 @@ function SignIn({ setIsAuthenticated, setUser }) {
// Store the full user object in state, so we can check user.is_premium, etc.
if (setUser && user) {
setUser(user);
- }
-
- const userCareerSituation = user.career_situation;
-
- const careerSituationRouteMap = {
- planning: '/planning',
- preparing: '/preparing',
- enhancing: '/enhancing',
- retirement: '/retirement',
- };
-
- if (careerSituationRouteMap[userCareerSituation]) {
- navigate(careerSituationRouteMap[userCareerSituation]);
- } else {
- navigate('/getting-started'); // fallback if undefined
+
+ navigate('/signin-landing'); // fallback if undefined
}
} catch (error) {
diff --git a/src/components/SignInLanding.js b/src/components/SignInLanding.js
new file mode 100644
index 0000000..7e38370
--- /dev/null
+++ b/src/components/SignInLanding.js
@@ -0,0 +1,43 @@
+// SignInLanding.jsx
+import React from 'react';
+import { Link } from 'react-router-dom';
+
+function SignInLanding({ user }) {
+ return (
+
+
+ Welcome to AptivaAI {user?.firstname}!
+
+
+ At AptivaAI, we aim to arm you with all the knowledge and guidance we wish we had when making our own career decisions. Today’s workplace is changing faster than ever, driven largely by AI—but our goal is to use that same technology to empower job seekers, not replace them.
+
+We blend data-backed insights with human-centered design, giving you practical recommendations and real-world context so you stay in the driver’s seat of your career. Whether you’re planning your first step, enhancing your current role, or ready to pivot entirely, our platform keeps you in control—helping you adapt, grow, and thrive on your own terms.
+
+
+
Planning: Just starting out? Looking for a different career that is a better fit? Explore options and figure out what careers match your interests and skills.
+
Preparing: Know what you want but just not how to get there? Gain education, skills, or certifications required to start or transition.
+
Enhancing: You've got some experience in your field but want to know how to get to the next level? Advance, seek promotions, or shift roles for an established professional.
+
Retirement: On your happy path and want to make sure you're financially ready when the time comes? Prepare financially and strategically for retirement.
+
+
+ Where would you like to go next?
+
+
+
+ Go to Planning
+
+
+ Go to Preparing
+
+
+ Go to Enhancing
+
+
+ Go to Retirement
+
+
+
+ );
+}
+
+export default SignInLanding;
diff --git a/src/components/SignUp.js b/src/components/SignUp.js
index 6a45141..3f02109 100644
--- a/src/components/SignUp.js
+++ b/src/components/SignUp.js
@@ -174,47 +174,56 @@ function SignUp() {
};
- const handleSituationConfirm = async () => {
-
- try {
- console.log("Payload sent to backend:", {
- username, password, firstname, lastname, email, zipcode, state, area,
+ // SignUp.jsx
+const handleSituationConfirm = async () => {
+ setShowPrompt(false);
+
+ try {
+ const response = await fetch('/api/register', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({
+ username,
+ password,
+ firstname,
+ lastname,
+ email,
+ zipcode,
+ state,
+ area,
career_situation: selectedSituation.id
- });
-
- const response = await fetch('/api/register', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- username,
- password,
- firstname,
- lastname,
- email,
- zipcode,
- state,
- area,
- career_situation: selectedSituation.id
- }),
-});
-
- const data = await response.json();
-
- if (!response.ok) {
- setError(data.error || 'Registration failed. Please try again.');
- setShowPrompt(false);
- return;
- }
-
- navigate(selectedSituation.route);
- } catch (err) {
- console.error(err);
- setError('An unexpected error occurred. Please try again later.');
- setShowPrompt(false);
+ }),
+ });
+
+ const data = await response.json();
+ if (!response.ok) {
+ setError(data.error || 'Registration failed. Please try again.');
+ return;
}
- };
-
-
+
+ // If the server returns a token, store it so that App.js will consider them authenticated
+ if (data.token) {
+ localStorage.setItem('token', data.token);
+ }
+
+ // If the server also returned 'user', set it in the main state
+ // But we need a way to pass "setUser" down to SignUp or use a context
+ if (data.user) {
+ setUsername(data.user);
+ } else {
+ // Optionally, fetch user from /api/user-profile:
+ // This ensures your user object is set in App.js
+ // But if your App.js auto-fetches the user from the token, you can skip this
+ }
+
+ // Now that we have a token + user, let's direct them to the route
+ navigate(selectedSituation.route);
+ } catch (err) {
+ console.error('Registration error:', err);
+ setError('An unexpected error occurred. Please try again later.');
+ }
+};
+
return (