Skip to content

Commit

Permalink
Merge pull request #135 from ajinkyapandetekdi/all-1.2
Browse files Browse the repository at this point in the history
Issueid #223945 fix: When user is log out we are redirecting to home page
  • Loading branch information
deepali-chavhan authored Aug 6, 2024
2 parents 4c96377 + c9eabbf commit e6ba754
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all-app-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
REACT_APP_POST_LEARNER_PROGRESS: ${{ vars.REACT_APP_POST_LEARNER_PROGRESS }}
REACT_APP_IS_APP_IFRAME: ${{ vars.REACT_APP_IS_APP_IFRAME }}
REACT_APP_IS_IN_APP_AUTHORISATION: ${{ vars.REACT_APP_IS_IN_APP_AUTHORISATION }}
REACT_APP_IS_APP_LANGUAGES: ${{ vars.REACT_APP_IS_APP_LANGUAGES }}
REACT_APP_LANGUAGES: ${{ vars.REACT_APP_LANGUAGES }}
CI: false # Disabling CI to not treat warnings as errors
run: npm run build

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/all-prod-rig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
REACT_APP_POST_LEARNER_PROGRESS: ${{ vars.REACT_APP_POST_LEARNER_PROGRESS }}
REACT_APP_IS_APP_IFRAME: ${{ vars.REACT_APP_IS_APP_IFRAME }}
REACT_APP_IS_IN_APP_AUTHORISATION: ${{ vars.REACT_APP_IS_IN_APP_AUTHORISATION }}
REACT_APP_IS_APP_LANGUAGES: ${{ vars.REACT_APP_IS_APP_LANGUAGES }}
REACT_APP_LANGUAGES: ${{ vars.REACT_APP_LANGUAGES }}
CI: false # Disabling CI to not treat warnings as errors
run: npm run build

Expand Down
2 changes: 1 addition & 1 deletion src/components/Assesment/Assesment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export const ProfileHeader = ({
const handleLogout = () => {
localStorage.clear();
end({});
navigate("/Login");
navigate("/login");
};

const CustomIconButton = styled(IconButton)({
Expand Down
24 changes: 12 additions & 12 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
import * as reviews from "../views";

const routData = [
{
id: "route-001",
path: "/",
component: reviews.DiscoverStart,
requiresAuth: true,
},
{
id: "route-002",
path: "/discover",
Expand Down Expand Up @@ -53,6 +59,12 @@ const routData = [
component: reviews.PracticeRedirectPage,
requiresAuth: true,
},
{
id: "route-010",
path: "/login",
component: reviews.LoginPage,
requiresAuth: false,
},
];
// add login route for test rig

Expand All @@ -61,12 +73,6 @@ const isLogin = import.meta.env.VITE_APP_IS_IN_APP_AUTHORISATION === 'true';

if (isLogin && !virtualId) {
routData.push(
{
id: "route-001",
path: "/",
component: reviews.LoginPage,
requiresAuth: true,
},
{
id: "route-000",
path: "*",
Expand All @@ -76,12 +82,6 @@ if (isLogin && !virtualId) {
);
}else {
routData.push(
{
id: "route-001",
path: "/",
component: reviews.DiscoverStart,
requiresAuth: false,
},
{
id: "route-000",
path: "*",
Expand Down
2 changes: 1 addition & 1 deletion src/views/AppContent/AppContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PrivateRoute = (props) => {
const navigate = useNavigate();
useEffect(() => {
if (!virtualId && props.requiresAuth) {
navigate("/");
navigate("/login");
}
}, [virtualId]);

Expand Down

0 comments on commit e6ba754

Please sign in to comment.