[GH-ISSUE #261] [BUG] Create missing landing and clerk signin page. #178

Closed
opened 2026-03-02 23:34:15 +03:00 by kerem · 3 comments
Owner

Originally created by @AJaySi on GitHub (Sep 27, 2025).
Original GitHub issue: https://github.com/AJaySi/ALwrity/issues/261

Originally assigned to: @AJaySi on GitHub.

I'll scan the codebase to locate the landing page, Clerk auth integration, onboarding flow logic, and backend endpoints or middleware that support onboarding and auth. Then I'll dive into the key files those searches reveal.

[5 tools called]

I'll gather the key frontend and backend files in parallel to map the current routing, auth headers, and onboarding endpoints before outlining gaps.

[5 tools called]

I scanned the frontend routing, auth usage, onboarding flows, and backend endpoints involved. I’ll summarize what’s present and what’s missing to support your desired UX.

Landing page

  • Current state (no landing page; “/” decides onboarding vs dashboard based on backend status):
// Component to handle initial routing based on onboarding status
const InitialRouteHandler: React.FC = () => {
  const [loading, setLoading] = useState(true);
  const [onboardingComplete, setOnboardingComplete] = useState(false);
  const [error, setError] = useState<string | null>(null);

  useEffect(() => {
    const checkOnboardingStatus = async () => {
      try {
        console.log('Checking onboarding status...');
        const response = await apiClient.get('/api/onboarding/status');
        const status = response.data;
        
        console.log('Onboarding status:', status);
        
        if (status.is_completed) {
          console.log('Onboarding is complete, redirecting to dashboard');
          setOnboardingComplete(true);
        } else {
          console.log('Onboarding not complete, staying on onboarding');
          setOnboardingComplete(false);
        }
      } catch (err) {
<Routes>
  <Route path="/" element={<InitialRouteHandler />} />
  <Route path="/onboarding" element={<Wizard />} />
  <Route path="/dashboard" element={<ProtectedRoute><MainDashboard /></ProtectedRoute>} />
  <Route path="/seo" element={<ProtectedRoute><SEODashboard /></ProtectedRoute>} />
  <Route path="/seo-dashboard" element={<ProtectedRoute><SEODashboard /></ProtectedRoute>} />
  <Route path="/content-planning" element={<ProtectedRoute><ContentPlanningDashboard /></ProtectedRoute>} />
  • Gaps vs goal:

    • No landing page component.
    • No Clerk SignedOut UX or “Get Started Free - BYOK” CTA that triggers Clerk sign-in.
    • “/” immediately calls onboarding status; when signed-out this produces an error-state instead of showing a marketing page.
  • Needed implementation:

    • Add Landing component with “Get Started Free - BYOK” using Clerk SignInButton (social logins).
    • Update “/” route to render:
      • SignedOut: Landing
      • SignedIn: current InitialRouteHandler
    • Ensure CTA redirects to onboarding after first sign-in (or to dashboard if already completed).

Clerk authentication usage

  • Current state:
    • Clerk provider configured with env keys, but no SignedIn/SignedOut routing and no sign-in page/buttons in app shell.
// Get environment variables with fallbacks
const clerkPublishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY || '';
const copilotApiKey = process.env.REACT_APP_COPILOTKIT_API_KEY || '';

// Show error if required keys are missing
if (!clerkPublishableKey) {
  return (
    <Box sx={{ p: 3, textAlign: 'center' }}>
      <Typography color="error" variant="h6">
        Missing Clerk Publishable Key
      </Typography>
      <Typography variant="body2" sx={{ mt: 1 }}>
        Please add REACT_APP_CLERK_PUBLISHABLE_KEY to your .env file
      </Typography>
    </Box>
  );
}

return (
  <ClerkProvider publishableKey={clerkPublishableKey}>
  ...
  • API client does not attach Clerk tokens.
import axios from 'axios';

// Create a shared axios instance for all API calls (same-origin; CRA proxy forwards to backend)
export const apiClient = axios.create({
  baseURL: '',
  timeout: 60000, // Increased to 60 seconds for regular API calls
  headers: {
    'Content-Type': 'application/json',
  },
});

// Create a specialized client for AI operations with extended timeout
export const aiApiClient = axios.create({
  baseURL: '',
  • Backend auth middleware exists but is simplified and not integrated with most endpoints:
class ClerkAuthMiddleware:
    """Clerk authentication middleware."""
    
def __init__(self):
        """Initialize Clerk authentication middleware."""
        self.clerk_secret_key = os.getenv('CLERK_SECRET_KEY')
        self.disable_auth = os.getenv('DISABLE_AUTH', 'false').lower() == 'true'
        
        if not self.clerk_secret_key and not self.disable_auth:
")

        logger.info(f"ClerkAuthMiddleware initialized - Auth disabled: {self.disable_auth}")
    
async def verify_token(self, token: str) -> Optional[Dict[str, Any]]:
        """Verify Clerk JWT token."""
        try:
            if self.disable_auth:
                logger.info("Authentication disabled, returning mock user")
                return {
                    'id': 'mock_user_id',
...
            # Temporary simplified token validation for development
            # This accepts any token that looks like a Clerk token
            if token and len(token) > 50 and token.startswith('eyJ'):
                logger.info("Token validation passed (simplified mode)")
                return {
                    'id': 'dev_user_id',
...
  • Gaps vs goal:

    • No token on API requests → backend can’t know the current user.
    • Onboarding endpoints are public and not user-scoped, so you can’t distinguish new vs existing users.
    • No redirect to sign-in when accessing protected routes while signed-out.
  • Needed implementation:

    • Add axios interceptor to attach Clerk JWT to Authorization: Bearer <token>.
    • Use SignedIn/SignedOut blocks for “/”, and update ProtectedRoute to check Clerk auth before onboarding.
    • Harden backend auth: verify Clerk JWT (prod mode) and require Depends(get_current_user) on onboarding and dashboard-critical endpoints.

Onboarding flow

  • Frontend gating for protected routes is based solely on onboarding status, not sign-in state:
const ProtectedRoute: React.FC<ProtectedRouteProps> = ({ children }) => {
  const [loading, setLoading] = useState(true);
  const [onboardingComplete, setOnboardingComplete] = useState(false);
  const [error, setError] = useState<string | null>(null);

  useEffect(() => {
    const checkOnboardingStatus = async () => {
      try {
        console.log('ProtectedRoute: Checking onboarding status...');
        const response = await apiClient.get('/api/onboarding/status');
        const status: OnboardingStatus = response.data;
        
        console.log('ProtectedRoute: Onboarding status:', status);
        
        if (status.is_completed) {
          console.log('ProtectedRoute: Onboarding is complete, allowing access');
          setOnboardingComplete(true);
        } else {
          console.log('ProtectedRoute: Onboarding not complete, redirecting to onboarding');
          setOnboardingComplete(false);
        }
      } catch (err) {
// If onboarding is not complete, redirect to onboarding
if (!onboardingComplete) {
  console.log('ProtectedRoute: Redirecting to onboarding');
  return <Navigate to="/onboarding" replace />;
}

// If onboarding is complete, render the protected component
console.log('ProtectedRoute: Rendering protected component');
return <>{children}</>;
  • Backend get_onboarding_status is mocked to always completed (blocks onboarding entirely):
# TEMPORARY: Mock onboarding as completed for Wix testing
# TODO: Remove this mock after testing
logger.info("[get_onboarding_status] TEMPORARY: Returning mocked completed onboarding status for Wix testing")
return OnboardingStatusResponse(
    is_completed=True,
    current_step=5,
    completion_percentage=100,
    next_step=None,
    started_at=datetime.now().isoformat(),
    completed_at=datetime.now().isoformat(),
    can_proceed_to_final=True
)
  • Onboarding endpoints are exposed without user dependency:
@app.get("/api/onboarding/status")
async def onboarding_status():
    """Get the current onboarding status."""
    try:
        return await get_onboarding_status()
    except Exception as e:
        logger.error(f"Error in onboarding_status: {e}")
        raise HTTPException(status_code=500, detail=str(e))
@app.post("/api/onboarding/start")
async def onboarding_start():
    """Start a new onboarding session."""
    try:
        return await start_onboarding()
    except Exception as e:
        logger.error(f"Error in onboarding_start: {e}")
        raise HTTPException(status_code=500, detail=str(e))
  • Onboarding state manager isn’t user-scoped; DB model exists but unused:
class OnboardingSession(Base):
    __tablename__ = 'onboarding_sessions'
    id = Column(Integer, primary_key=True, autoincrement=True)
    user_id = Column(Integer, nullable=False)  # Replace with ForeignKey if you have a user table
    current_step = Column(Integer, default=1)
    progress = Column(Float, default=0.0)
    started_at = Column(DateTime, default=func.now())
    updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
  • Gaps vs goal:

    • Mocked “completed” blocks the onboarding screen.
    • Onboarding progress is global, not per user. No way to tell new vs existing.
    • No enforcement that signed-in is required to proceed to onboarding or dashboard.
    • No redirect logic to onboarding only when authenticated and incomplete.
  • Needed implementation:

    • Remove the mock in get_onboarding_status and return user-specific data.
    • Introduce per-user onboarding storage (e.g., use OnboardingSession keyed by Clerk user id).
    • Protect onboarding endpoints with Depends(get_current_user) and read user_id from token to scope progress.
    • Update ProtectedRoute to:
      • If not signed in → redirect to landing/sign-in
      • If signed in and onboarding incomplete → redirect to /onboarding
      • Else → render children
    • Ensure Wizard reads and writes per-user progress and completes onboarding for that specific user.

End-to-end flow alignment with desired UX

  • New, signed-out user visits “/”:
    • Show landing with “Get Started Free - BYOK” (Clerk social sign-in).
  • After successful sign-in:
    • Backend identifies user via Clerk token.
    • If onboarding incomplete → redirect to /onboarding.
    • If onboarding complete → redirect to /dashboard.
  • Returning user who completed onboarding:
    • Skip landing and onboarding; go directly to /dashboard.

Concrete implementation tasks

  • Frontend
    • Add Landing component with CTA using SignInButton (set afterSignInUrl to / or /onboarding).
    • Update “/” route: SignedOutLanding; SignedInInitialRouteHandler.
    • Update ProtectedRoute to check Clerk auth first; if signed-out → redirect to /.
    • Add axios request interceptor to include Authorization: Bearer <ClerkToken> on all API requests.
  • Backend
    • Remove temporary mock in get_onboarding_status.
    • Require Depends(get_current_user) on onboarding endpoints (status, progress, start, complete, step operations).
    • Map Clerk user id to internal user_id and persist onboarding per user:
      • Use OnboardingSession or extend OnboardingProgress to be user-scoped.
    • Make get_onboarding_status return per-user completion.
    • Strengthen Clerk auth middleware (disable simplified acceptance; verify JWT or Clerk introspection) in non-dev.
  • UX routing
    • Ensure CTA (BYOK) redirects to onboarding if first-time; otherwise dashboard.
    • Optionally add deep links: after sign-up → onboarding; after sign-in (existing) → dashboard.

implement:

  • A Landing component + routing changes.
  • Auth token interceptor in apiClient.
  • Backend changes to protect onboarding and scope it per user (using Clerk sub as user_id).
  • Removal of the mock and wiring status to the per-user session.

Summary

  • Frontend currently lacks a landing page and sign-in CTA; “/” immediately pings onboarding and navigates to onboarding/dashboard without considering sign-in.
  • API client doesn’t send Clerk tokens; backend onboarding endpoints are not user-scoped or protected.
  • Backend onboarding status is mocked as completed; onboarding progress is not associated to a user.
  • Implement landing + Clerk sign-in flow, attach tokens to requests, protect and user-scope onboarding endpoints, and remove the mock to meet the new/existing user routing requirements.
Originally created by @AJaySi on GitHub (Sep 27, 2025). Original GitHub issue: https://github.com/AJaySi/ALwrity/issues/261 Originally assigned to: @AJaySi on GitHub. I'll scan the codebase to locate the landing page, Clerk auth integration, onboarding flow logic, and backend endpoints or middleware that support onboarding and auth. Then I'll dive into the key files those searches reveal. [5 tools called] I'll gather the key frontend and backend files in parallel to map the current routing, auth headers, and onboarding endpoints before outlining gaps. [5 tools called] I scanned the frontend routing, auth usage, onboarding flows, and backend endpoints involved. I’ll summarize what’s present and what’s missing to support your desired UX. ### Landing page - Current state (no landing page; “/” decides onboarding vs dashboard based on backend status): ```38:60:frontend/src/App.tsx // Component to handle initial routing based on onboarding status const InitialRouteHandler: React.FC = () => { const [loading, setLoading] = useState(true); const [onboardingComplete, setOnboardingComplete] = useState(false); const [error, setError] = useState<string | null>(null); useEffect(() => { const checkOnboardingStatus = async () => { try { console.log('Checking onboarding status...'); const response = await apiClient.get('/api/onboarding/status'); const status = response.data; console.log('Onboarding status:', status); if (status.is_completed) { console.log('Onboarding is complete, redirecting to dashboard'); setOnboardingComplete(true); } else { console.log('Onboarding not complete, staying on onboarding'); setOnboardingComplete(false); } } catch (err) { ``` ```206:214:frontend/src/App.tsx <Routes> <Route path="/" element={<InitialRouteHandler />} /> <Route path="/onboarding" element={<Wizard />} /> <Route path="/dashboard" element={<ProtectedRoute><MainDashboard /></ProtectedRoute>} /> <Route path="/seo" element={<ProtectedRoute><SEODashboard /></ProtectedRoute>} /> <Route path="/seo-dashboard" element={<ProtectedRoute><SEODashboard /></ProtectedRoute>} /> <Route path="/content-planning" element={<ProtectedRoute><ContentPlanningDashboard /></ProtectedRoute>} /> ``` - Gaps vs goal: - No landing page component. - No Clerk `SignedOut` UX or “Get Started Free - BYOK” CTA that triggers Clerk sign-in. - “/” immediately calls onboarding status; when signed-out this produces an error-state instead of showing a marketing page. - Needed implementation: - Add `Landing` component with “Get Started Free - BYOK” using Clerk `SignInButton` (social logins). - Update “/” route to render: - SignedOut: `Landing` - SignedIn: current `InitialRouteHandler` - Ensure CTA redirects to onboarding after first sign-in (or to dashboard if already completed). ### Clerk authentication usage - Current state: - Clerk provider configured with env keys, but no `SignedIn`/`SignedOut` routing and no sign-in page/buttons in app shell. ```178:200:frontend/src/App.tsx // Get environment variables with fallbacks const clerkPublishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY || ''; const copilotApiKey = process.env.REACT_APP_COPILOTKIT_API_KEY || ''; // Show error if required keys are missing if (!clerkPublishableKey) { return ( <Box sx={{ p: 3, textAlign: 'center' }}> <Typography color="error" variant="h6"> Missing Clerk Publishable Key </Typography> <Typography variant="body2" sx={{ mt: 1 }}> Please add REACT_APP_CLERK_PUBLISHABLE_KEY to your .env file </Typography> </Box> ); } return ( <ClerkProvider publishableKey={clerkPublishableKey}> ... ``` - API client does not attach Clerk tokens. ```1:15:frontend/src/api/client.ts import axios from 'axios'; // Create a shared axios instance for all API calls (same-origin; CRA proxy forwards to backend) export const apiClient = axios.create({ baseURL: '', timeout: 60000, // Increased to 60 seconds for regular API calls headers: { 'Content-Type': 'application/json', }, }); // Create a specialized client for AI operations with extended timeout export const aiApiClient = axios.create({ baseURL: '', ``` - Backend auth middleware exists but is simplified and not integrated with most endpoints: ```18:59:backend/middleware/auth_middleware.py class ClerkAuthMiddleware: """Clerk authentication middleware.""" def __init__(self): """Initialize Clerk authentication middleware.""" self.clerk_secret_key = os.getenv('CLERK_SECRET_KEY') self.disable_auth = os.getenv('DISABLE_AUTH', 'false').lower() == 'true' if not self.clerk_secret_key and not self.disable_auth: ") logger.info(f"ClerkAuthMiddleware initialized - Auth disabled: {self.disable_auth}") async def verify_token(self, token: str) -> Optional[Dict[str, Any]]: """Verify Clerk JWT token.""" try: if self.disable_auth: logger.info("Authentication disabled, returning mock user") return { 'id': 'mock_user_id', ... # Temporary simplified token validation for development # This accepts any token that looks like a Clerk token if token and len(token) > 50 and token.startswith('eyJ'): logger.info("Token validation passed (simplified mode)") return { 'id': 'dev_user_id', ... ``` - Gaps vs goal: - No token on API requests → backend can’t know the current user. - Onboarding endpoints are public and not user-scoped, so you can’t distinguish new vs existing users. - No redirect to sign-in when accessing protected routes while signed-out. - Needed implementation: - Add axios interceptor to attach Clerk JWT to `Authorization: Bearer <token>`. - Use `SignedIn`/`SignedOut` blocks for “/”, and update `ProtectedRoute` to check Clerk auth before onboarding. - Harden backend auth: verify Clerk JWT (prod mode) and require `Depends(get_current_user)` on onboarding and dashboard-critical endpoints. ### Onboarding flow - Frontend gating for protected routes is based solely on onboarding status, not sign-in state: ```20:41:frontend/src/components/shared/ProtectedRoute.tsx const ProtectedRoute: React.FC<ProtectedRouteProps> = ({ children }) => { const [loading, setLoading] = useState(true); const [onboardingComplete, setOnboardingComplete] = useState(false); const [error, setError] = useState<string | null>(null); useEffect(() => { const checkOnboardingStatus = async () => { try { console.log('ProtectedRoute: Checking onboarding status...'); const response = await apiClient.get('/api/onboarding/status'); const status: OnboardingStatus = response.data; console.log('ProtectedRoute: Onboarding status:', status); if (status.is_completed) { console.log('ProtectedRoute: Onboarding is complete, allowing access'); setOnboardingComplete(true); } else { console.log('ProtectedRoute: Onboarding not complete, redirecting to onboarding'); setOnboardingComplete(false); } } catch (err) { ``` ```96:104:frontend/src/components/shared/ProtectedRoute.tsx // If onboarding is not complete, redirect to onboarding if (!onboardingComplete) { console.log('ProtectedRoute: Redirecting to onboarding'); return <Navigate to="/onboarding" replace />; } // If onboarding is complete, render the protected component console.log('ProtectedRoute: Rendering protected component'); return <>{children}</>; ``` - Backend `get_onboarding_status` is mocked to always completed (blocks onboarding entirely): ```83:95:backend/api/onboarding.py # TEMPORARY: Mock onboarding as completed for Wix testing # TODO: Remove this mock after testing logger.info("[get_onboarding_status] TEMPORARY: Returning mocked completed onboarding status for Wix testing") return OnboardingStatusResponse( is_completed=True, current_step=5, completion_percentage=100, next_step=None, started_at=datetime.now().isoformat(), completed_at=datetime.now().isoformat(), can_proceed_to_final=True ) ``` - Onboarding endpoints are exposed without user dependency: ```245:255:backend/app.py @app.get("/api/onboarding/status") async def onboarding_status(): """Get the current onboarding status.""" try: return await get_onboarding_status() except Exception as e: logger.error(f"Error in onboarding_status: {e}") raise HTTPException(status_code=500, detail=str(e)) ``` ```329:344:backend/app.py @app.post("/api/onboarding/start") async def onboarding_start(): """Start a new onboarding session.""" try: return await start_onboarding() except Exception as e: logger.error(f"Error in onboarding_start: {e}") raise HTTPException(status_code=500, detail=str(e)) ``` - Onboarding state manager isn’t user-scoped; DB model exists but unused: ```8:21:backend/models/onboarding.py class OnboardingSession(Base): __tablename__ = 'onboarding_sessions' id = Column(Integer, primary_key=True, autoincrement=True) user_id = Column(Integer, nullable=False) # Replace with ForeignKey if you have a user table current_step = Column(Integer, default=1) progress = Column(Float, default=0.0) started_at = Column(DateTime, default=func.now()) updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) ``` - Gaps vs goal: - Mocked “completed” blocks the onboarding screen. - Onboarding progress is global, not per user. No way to tell new vs existing. - No enforcement that signed-in is required to proceed to onboarding or dashboard. - No redirect logic to onboarding only when authenticated and incomplete. - Needed implementation: - Remove the mock in `get_onboarding_status` and return user-specific data. - Introduce per-user onboarding storage (e.g., use `OnboardingSession` keyed by Clerk user id). - Protect onboarding endpoints with `Depends(get_current_user)` and read `user_id` from token to scope progress. - Update `ProtectedRoute` to: - If not signed in → redirect to landing/sign-in - If signed in and onboarding incomplete → redirect to `/onboarding` - Else → render children - Ensure `Wizard` reads and writes per-user progress and completes onboarding for that specific user. ### End-to-end flow alignment with desired UX - New, signed-out user visits “/”: - Show landing with “Get Started Free - BYOK” (Clerk social sign-in). - After successful sign-in: - Backend identifies user via Clerk token. - If onboarding incomplete → redirect to `/onboarding`. - If onboarding complete → redirect to `/dashboard`. - Returning user who completed onboarding: - Skip landing and onboarding; go directly to `/dashboard`. ### Concrete implementation tasks - Frontend - Add `Landing` component with CTA using `SignInButton` (set `afterSignInUrl` to `/` or `/onboarding`). - Update “/” route: `SignedOut` → `Landing`; `SignedIn` → `InitialRouteHandler`. - Update `ProtectedRoute` to check Clerk auth first; if signed-out → redirect to `/`. - Add axios request interceptor to include `Authorization: Bearer <ClerkToken>` on all API requests. - Backend - Remove temporary mock in `get_onboarding_status`. - Require `Depends(get_current_user)` on onboarding endpoints (status, progress, start, complete, step operations). - Map Clerk user id to internal `user_id` and persist onboarding per user: - Use `OnboardingSession` or extend `OnboardingProgress` to be user-scoped. - Make `get_onboarding_status` return per-user completion. - Strengthen Clerk auth middleware (disable simplified acceptance; verify JWT or Clerk introspection) in non-dev. - UX routing - Ensure CTA (BYOK) redirects to onboarding if first-time; otherwise dashboard. - Optionally add deep links: after sign-up → onboarding; after sign-in (existing) → dashboard. implement: - A `Landing` component + routing changes. - Auth token interceptor in `apiClient`. - Backend changes to protect onboarding and scope it per user (using Clerk `sub` as `user_id`). - Removal of the mock and wiring status to the per-user session. Summary - Frontend currently lacks a landing page and sign-in CTA; “/” immediately pings onboarding and navigates to onboarding/dashboard without considering sign-in. - API client doesn’t send Clerk tokens; backend onboarding endpoints are not user-scoped or protected. - Backend onboarding status is mocked as completed; onboarding progress is not associated to a user. - Implement landing + Clerk sign-in flow, attach tokens to requests, protect and user-scope onboarding endpoints, and remove the mock to meet the new/existing user routing requirements.
kerem 2026-03-02 23:34:15 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@AJaySi commented on GitHub (Sep 27, 2025):

Quick status:

  1. Implemented Landing and routing; checked lints and imports—no errors reported. I’ll leave token interceptors and backend scoping for a later step.
    Changes of note
    New file frontend/src/components/Landing/Landing.tsx with a minimal marketing hero and a “Get Started Free - BYOK” button that redirects to / post sign-in.
    Root route in frontend/src/App.tsx now wraps / with SignedOut → Landing and SignedIn → InitialRouteHandler.
<!-- gh-comment-id:3341345252 --> @AJaySi commented on GitHub (Sep 27, 2025): Quick status: 1) Implemented Landing and routing; checked lints and imports—no errors reported. I’ll leave token interceptors and backend scoping for a later step. Changes of note New file frontend/src/components/Landing/Landing.tsx with a minimal marketing hero and a “Get Started Free - BYOK” button that redirects to / post sign-in. Root route in frontend/src/App.tsx now wraps / with SignedOut → Landing and SignedIn → InitialRouteHandler.
Author
Owner

@AJaySi commented on GitHub (Sep 27, 2025):

Next steps to implement
Add axios auth header interceptor to send Clerk token on all API calls, so onboarding status is user-specific:
In frontend/src/api/client.ts, set up a request interceptor that retrieves getToken() from Clerk and sets Authorization: Bearer .
Protect backend onboarding endpoints with auth and scope progress by user:
Add Depends(get_current_user) to /api/onboarding/status, /api/onboarding/*.
Use Clerk user id from token to read/write per-user onboarding state.
Remove the temporary mock in backend/api/onboarding.py#get_onboarding_status so the frontend routing works correctly for new vs returning users.
Update ProtectedRoute to also respect sign-in:
If not signed in, redirect to /.
If signed in and onboarding incomplete, redirect to /onboarding; else render the child.

<!-- gh-comment-id:3341345797 --> @AJaySi commented on GitHub (Sep 27, 2025): Next steps to implement Add axios auth header interceptor to send Clerk token on all API calls, so onboarding status is user-specific: In frontend/src/api/client.ts, set up a request interceptor that retrieves getToken() from Clerk and sets Authorization: Bearer <token>. Protect backend onboarding endpoints with auth and scope progress by user: Add Depends(get_current_user) to /api/onboarding/status, /api/onboarding/*. Use Clerk user id from token to read/write per-user onboarding state. Remove the temporary mock in backend/api/onboarding.py#get_onboarding_status so the frontend routing works correctly for new vs returning users. Update ProtectedRoute to also respect sign-in: If not signed in, redirect to /. If signed in and onboarding incomplete, redirect to /onboarding; else render the child.
Author
Owner

@AJaySi commented on GitHub (Oct 9, 2025):

@Om-Singh1808 @uniqueumesh @DikshaDisciplines

I am closing this ticket as you all have verified it.

<!-- gh-comment-id:3384432671 --> @AJaySi commented on GitHub (Oct 9, 2025): @Om-Singh1808 @uniqueumesh @DikshaDisciplines I am closing this ticket as you all have verified it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#178
No description provided.