This is my protected route

import React from “react”;
import { Outlet } from “react-router-dom”;
import { useOktaAuth } from “@okta/okta-react”;

const ProtectedRoute = async ({ element }) => {
const { authState, oktaAuth } = useOktaAuth();

if (!authState || !authState.isAuthenticated) {
oktaAuth.signInWithRedirect({ originalUri: “/***/home” });
} else {
return ;

export default ProtectedRoute;

When the user clicks http://localhost:3000/***/home, it redirects the user to org sign in page and once the user signs in , it redirects to application home page. Except okta-token-storage , am able to see remaining details in my browser?

Why am not getting okta-token-storage empty object? What should need to get the okta-toke-storage? And also there is no Okta logs, and my application has never hit /token endpoint ? could anyone knows how to solve this issue?


I’m not sure I understand the issue you are having. Are you seeing your application make any requests to log the user into Okta (in particular, to the /authorize or /token endpoints)? Are these requests succeeding or failing? If they are failing, what errors are you seeing (in either the Network tab or the Console)?