From 81c299dd99a3d509036f0891e3f7ebc54b98e75c Mon Sep 17 00:00:00 2001
From: "makabe.t"
{t(getTranslationID("filePropertyPopup.label.close"))}
diff --git a/dictation_client/src/pages/LoginPage/index.tsx b/dictation_client/src/pages/LoginPage/index.tsx
index e298c40..c335bd3 100644
--- a/dictation_client/src/pages/LoginPage/index.tsx
+++ b/dictation_client/src/pages/LoginPage/index.tsx
@@ -28,6 +28,33 @@ const LoginPage: React.FC = (): JSX.Element => {
selectLocalStorageKeyforIdToken
);
+ // ログイン後の遷移先を決定する
+ const navigateToLoginedPage = useCallback(() => {
+ // 第一~第四階層の管理者はライセンス画面へ遷移
+ if (
+ isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
+ isAdminUser()
+ ) {
+ navigate("/license");
+ return;
+ }
+ // 第五階層の管理者はユーザー画面へ遷移
+ if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
+ navigate("/user");
+ return;
+ }
+ // 一般ユーザーはdictationPageへ遷移
+ if (isStandardUser()) {
+ navigate("/dictations");
+ return;
+ }
+ // それ以外は認証エラー画面へ遷移
+ instance.logoutRedirect({
+ postLogoutRedirectUri: "/AuthError",
+ });
+ clearToken();
+ }, [instance, navigate]);
+
const tokenSet = useCallback(
async (idToken: string) => {
// ログイン処理呼び出し
@@ -59,44 +86,36 @@ const LoginPage: React.FC = (): JSX.Element => {
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
- // 第一~第四階層の管理者はライセンス画面へ遷移
- if (
- isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
- isAdminUser()
- ) {
- navigate("/license");
- return;
- }
- // 第五階層の管理者はユーザー画面へ遷移
- if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
- navigate("/user");
- return;
- }
- // 一般ユーザーはdictationPageへ遷移
- if (isStandardUser()) {
- navigate("/dictations");
- return;
- }
- // それ以外は認証エラー画面へ遷移
- instance.logoutRedirect({
- postLogoutRedirectUri: "/AuthError",
- });
- clearToken();
+
+ // ログイン成功した場合、適切なページに遷移する
+ navigateToLoginedPage();
}
},
- [dispatch, i18n.language, instance, navigate]
+ [dispatch, i18n.language, instance, navigate, navigateToLoginedPage]
);
useEffect(() => {
- // AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する
- if (!localStorageKeyforIdToken) {
- navigate("/");
- return;
- }
-
+ // idTokenStringがあるか⇒認証中
+ // accessTokenがある場合⇒ログイン済み
+ // どちらもなければ直打ち
(async () => {
- // IDトークンの取得
+ if (loadAccessToken()) {
+ navigateToLoginedPage();
+ return;
+ }
+
+ // AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する
+ if (!localStorageKeyforIdToken) {
+ navigate("/");
+ return;
+ }
const idTokenString = localStorage.getItem(localStorageKeyforIdToken);
+
+ if (idTokenString === null) {
+ navigate("/");
+ return;
+ }
+
if (idTokenString) {
const idTokenObject = JSON.parse(idTokenString);
if (isIdToken(idTokenObject)) {
diff --git a/dictation_client/src/pages/TermsPage/index.tsx b/dictation_client/src/pages/TermsPage/index.tsx
index 974487e..52f2a0b 100644
--- a/dictation_client/src/pages/TermsPage/index.tsx
+++ b/dictation_client/src/pages/TermsPage/index.tsx
@@ -18,10 +18,19 @@ import {
} from "features//terms";
import { selectLocalStorageKeyforIdToken } from "features/login";
import { useNavigate } from "react-router-dom";
+import {
+ clearToken,
+ isAdminUser,
+ isApproveTier,
+ isStandardUser,
+ loadAccessToken,
+} from "features/auth";
+import { useMsal } from "@azure/msal-react";
const TermsPage: React.FC = (): JSX.Element => {
const [t] = useTranslation();
const dispatch: AppDispatch = useDispatch();
+ const { instance } = useMsal();
const navigate = useNavigate();
const updateAccceptVersions = useSelector(selectTermVersions);
const localStorageKeyforIdToken = useSelector(
@@ -40,6 +49,34 @@ const TermsPage: React.FC = (): JSX.Element => {
// 画面起動時
useEffect(() => {
+ // ログイン済みの場合、ログイン後の遷移先を決定する
+ if (loadAccessToken()) {
+ // 第一~第四階層の管理者はライセンス画面へ遷移
+ if (
+ isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
+ isAdminUser()
+ ) {
+ navigate("/license");
+ return;
+ }
+ // 第五階層の管理者はユーザー画面へ遷移
+ if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
+ navigate("/user");
+ return;
+ }
+ // 一般ユーザーはdictationPageへ遷移
+ if (isStandardUser()) {
+ navigate("/dictations");
+ return;
+ }
+ // それ以外は認証エラー画面へ遷移
+ instance.logoutRedirect({
+ postLogoutRedirectUri: "/AuthError",
+ });
+ clearToken();
+ return;
+ }
+
dispatch(getTermsInfoAsync());
if (localStorageKeyforIdToken) {
dispatch(getAccountInfoMinimalAccessAsync({ localStorageKeyforIdToken }));
diff --git a/dictation_client/src/pages/UserListPage/index.tsx b/dictation_client/src/pages/UserListPage/index.tsx
index 46f1223..a1de616 100644
--- a/dictation_client/src/pages/UserListPage/index.tsx
+++ b/dictation_client/src/pages/UserListPage/index.tsx
@@ -174,9 +174,6 @@ const UserListPage: React.FC = (): JSX.Element => {
{t(getTranslationID("userListPage.label.autoRenew"))}
-
- {t(getTranslationID("userListPage.label.licenseAlert"))}
-
{t(getTranslationID("userListPage.label.notification"))}
@@ -292,7 +289,6 @@ const UserListPage: React.FC = (): JSX.Element => {
{boolToElement(user.autoRenew)}
- {boolToElement(user.licenseAlert)}
{boolToElement(user.notification)}
{boolToElement(user.emailVerified)}
diff --git a/dictation_client/src/pages/UserListPage/popup.tsx b/dictation_client/src/pages/UserListPage/popup.tsx
index 50ed98f..97b3301 100644
--- a/dictation_client/src/pages/UserListPage/popup.tsx
+++ b/dictation_client/src/pages/UserListPage/popup.tsx
@@ -10,7 +10,6 @@ import {
changeRole,
changeAuthorId,
changeAutoRenew,
- changeLicenseAlert,
changeNotification,
cleanupAddUser,
addUserAsync,
@@ -324,22 +323,6 @@ export const UserAddPopup: React.FC
- -
-
- -
-
Temporary password:$TEMPORARY_PASSWORD$
+Temporary password: $TEMPORARY_PASSWORD$
If you need support regarding ODMS Cloud, please contact $PRIMARY_ADMIN_NAME$. @@ -34,7 +34,7 @@ Passwort zu ändern, klicken Sie auf dem ODMS Cloud-Anmeldebildschirm auf den Link [Kennwort vergessen?].
-Temporäres Passwort:$TEMPORARY_PASSWORD$
+Temporäres Passwort: $TEMPORARY_PASSWORD$
Wenn Sie Unterstützung bezüglich ODMS Cloud benötigen, wenden Sie sich bitte an $PRIMARY_ADMIN_NAME$. @@ -57,7 +57,7 @@ lien [Vous avez oublié votre mot de passe ?] sur l'écran de connexion ODMS Cloud.
-Temporary password:$TEMPORARY_PASSWORD$
+Temporary password: $TEMPORARY_PASSWORD$
Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez
contacter $PRIMARY_ADMIN_NAME$.
diff --git a/dictation_server/src/templates/template_U_113.txt b/dictation_server/src/templates/template_U_113.txt
index 5c444c6..f84bd50 100644
--- a/dictation_server/src/templates/template_U_113.txt
+++ b/dictation_server/src/templates/template_U_113.txt
@@ -2,7 +2,7 @@
Your user registration has been completed. Please login to ODMS Cloud with the following temporary password. You may continue using your temporary password; however, we strongly recommend that you change your password for security reasons. To change your password, click on [Forgot your password?] link on the ODMS Cloud Sign in screen.
-Temporary password:$TEMPORARY_PASSWORD$
+Temporary password: $TEMPORARY_PASSWORD$
If you need support regarding ODMS Cloud, please contact $PRIMARY_ADMIN_NAME$.
@@ -13,7 +13,7 @@ This is an automatically generated e-mail and this mailbox is not monitored. P
Ihre Benutzerregistrierung ist abgeschlossen. Bitte melden Sie sich mit dem folgenden temporären Passwort bei ODMS Cloud an. Sie können Ihr temporäres Passwort weiterhin verwenden; Aus Sicherheitsgründen empfehlen wir Ihnen jedoch dringend, Ihr Passwort zu ändern. Um Ihr Passwort zu ändern, klicken Sie auf dem ODMS Cloud-Anmeldebildschirm auf den Link [Kennwort vergessen?].
-Temporäres Passwort:$TEMPORARY_PASSWORD$
+Temporäres Passwort: $TEMPORARY_PASSWORD$
Wenn Sie Unterstützung bezüglich ODMS Cloud benötigen, wenden Sie sich bitte an $PRIMARY_ADMIN_NAME$.
@@ -24,7 +24,7 @@ Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht über
Votre inscription d'utilisateur est terminée. Veuillez vous connecter à ODMS Cloud avec le mot de passe temporaire suivant. Vous pouvez continuer à utiliser votre mot de passe temporaire ; cependant, nous vous recommandons fortement de changer votre mot de passe pour des raisons de sécurité. Pour modifier votre mot de passe, cliquez sur le lien [Vous avez oublié votre mot de passe ?] sur l'écran de connexion ODMS Cloud.
-Temporary password:$TEMPORARY_PASSWORD$
+Temporary password: $TEMPORARY_PASSWORD$
Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter $PRIMARY_ADMIN_NAME$.
From 8793606070aab4b2eb213a507fde98112a4f1dd1 Mon Sep 17 00:00:00 2001
From: "makabe.t"