joseph njoroge kariuki commited on
Commit
733b04d
Β·
1 Parent(s): 5c7593f

fix: route guard and landing page links for institutional login portal

Browse files
frontend/src/main.jsx CHANGED
@@ -39,8 +39,8 @@ function ProtectedRoute({ children }) {
39
  }
40
 
41
  function InstitutionalProtectedRoute({ children }) {
42
- const { isAuthenticated } = useAuthStore()
43
- return isAuthenticated ? children : <Navigate to="/login/institutional" />
44
  }
45
 
46
  function App() {
 
39
  }
40
 
41
  function InstitutionalProtectedRoute({ children }) {
42
+ const { isAuthenticated, user } = useAuthStore()
43
+ return (isAuthenticated && user?.user_type === 'institutional') ? children : <Navigate to="/login/institutional" />
44
  }
45
 
46
  function App() {
frontend/src/pages/LandingPage.jsx CHANGED
@@ -322,7 +322,7 @@ export default function LandingPage() {
322
  <li>Regulatory copilot β€” paste any CBK circular and get an impact analysis</li>
323
  <li>Role-based access: the UI changes completely by role (Auditor vs Risk Manager)</li>
324
  </ul>
325
- <Link to="/institutional" className="tier-cta red">Request institutional access</Link>
326
  </div>
327
  </div>
328
  </section>
@@ -382,7 +382,7 @@ export default function LandingPage() {
382
  <div className="cta-card-num re">03</div>
383
  <h3>Senti Institutional</h3>
384
  <p>For compliance teams, risk officers, and SACCOs that need a hardened control panel β€” not a consumer chat interface.</p>
385
- <Link to="/institutional" className="cta-card-btn btn-re">Request access β†’</Link>
386
  </div>
387
  </div>
388
  </section>
 
322
  <li>Regulatory copilot β€” paste any CBK circular and get an impact analysis</li>
323
  <li>Role-based access: the UI changes completely by role (Auditor vs Risk Manager)</li>
324
  </ul>
325
+ <Link to="/login/institutional" className="tier-cta red">Access Institutional Portal</Link>
326
  </div>
327
  </div>
328
  </section>
 
382
  <div className="cta-card-num re">03</div>
383
  <h3>Senti Institutional</h3>
384
  <p>For compliance teams, risk officers, and SACCOs that need a hardened control panel β€” not a consumer chat interface.</p>
385
+ <Link to="/login/institutional" className="cta-card-btn btn-re">Access Portal β†’</Link>
386
  </div>
387
  </div>
388
  </section>