Skip to content

Commit 30044e5

Browse files
committed
Add react router and realm and login url parameters
1 parent 5cce4e7 commit 30044e5

20 files changed

+386
-338
lines changed

openam-ui/openam-ui-js-sdk/package-lock.json

Lines changed: 53 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openam-ui/openam-ui-js-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
},
3030
"dependencies": {
3131
"react": "^19.2.0",
32-
"react-dom": "^19.2.0"
32+
"react-dom": "^19.2.0",
33+
"react-router": "^7.9.6"
3334
},
3435
"devDependencies": {
3536
"@eslint/js": "^9.36.0",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* The contents of this file are subject to the terms of the Common Development and
3+
* Distribution License (the License). You may not use this file except in compliance with the
4+
* License.
5+
*
6+
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
7+
* specific language governing permission and limitations under the License.
8+
*
9+
* When distributing Covered Software, include this CDDL Header Notice in each file and include
10+
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
11+
* Header, with the fields enclosed by brackets [] replaced by your own identifying
12+
* information: "Portions copyright [year] [name of copyright owner]".
13+
*
14+
* Copyright 2025 3A Systems LLC.
15+
*/
16+
17+
import { useEffect } from "react";
18+
import { useNavigate } from "react-router";
19+
import type { UserService } from "./userService";
20+
21+
export default function Home({userService}:{userService: UserService}) {
22+
23+
const navigate = useNavigate();
24+
const init = async () => {
25+
const userData = await userService.getUserIdFromSession()
26+
if (!userData || !userData.id) {
27+
navigate('/login')
28+
} else {
29+
navigate('/user')
30+
}
31+
}
32+
useEffect(() => {
33+
init();
34+
}, []);
35+
36+
return <h2>Loading</h2>;
37+
}

0 commit comments

Comments
 (0)