From 4105729f83098d0f289474f2b4ed56cb1aa77381 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:27:47 -0500 Subject: [PATCH 01/22] delete hash messages --- .../decoder/services/decoder.store.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/features/decoder/services/decoder.store.ts b/src/features/decoder/services/decoder.store.ts index 9eb5da52..d90303b9 100644 --- a/src/features/decoder/services/decoder.store.ts +++ b/src/features/decoder/services/decoder.store.ts @@ -10,11 +10,6 @@ import { AsymmetricKeyFormatValues } from "@/features/common/values/asymmetric-k import { JwtSignatureStatusValues } from "@/features/common/values/jwt-signature-status.values"; import { DecoderInputsModel } from "@/features/debugger/models/decoder-inputs.model"; -export enum HashWarningVisibilityValues { - VISIBLE = "VISIBLE", - HIDDEN = "HIDDEN", -} - export const DEFAULT_ALG_TYPE = "HS"; export const DEFAULT_ALG_SIZE = 256; export const DEFAULT_ALG = `${DEFAULT_ALG_TYPE}${DEFAULT_ALG_SIZE}`; @@ -63,7 +58,6 @@ export type DecoderStoreState = { decodingErrors: string[] | null; signatureWarnings: string[] | null; verificationInputErrors: string[] | null; - useHashWarningVisibility: HashWarningVisibilityValues; }; type DecoderStoreActions = { @@ -79,8 +73,6 @@ type DecoderStoreActions = { ) => void; resetControlledSymmetricSecretKey: () => void; resetControlledAsymmetricPublicKey: () => void; - showUseHashWarning: () => void; - hideUseHashWarning: () => void; loadDecoderInputs: (params: DecoderInputsModel) => void; }; @@ -100,7 +92,6 @@ export const initialState: DecoderStoreState = { controlledSymmetricSecretKey: null, controlledAsymmetricPublicKey: null, verificationInputErrors: null, - useHashWarningVisibility: HashWarningVisibilityValues.HIDDEN, }; export type DecoderStore = DecoderStoreState & DecoderStoreActions; @@ -204,16 +195,6 @@ export const useDecoderStore = create()( format: state.asymmetricPublicKeyFormat, }, })), - showUseHashWarning: () => { - set({ - useHashWarningVisibility: HashWarningVisibilityValues.VISIBLE, - }); - }, - hideUseHashWarning: () => { - set({ - useHashWarningVisibility: HashWarningVisibilityValues.HIDDEN, - }); - }, loadDecoderInputs: async (params) => { const update = await TokenDecoderService.loadDecoderInputs(params); From 745bc6954de4ee55a4ff124f65fb0251ccdf0797 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:29:16 -0500 Subject: [PATCH 02/22] delete hash component from layout --- src/app/[language]/layout.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/[language]/layout.tsx b/src/app/[language]/layout.tsx index 84ecb941..6335b3ca 100644 --- a/src/app/[language]/layout.tsx +++ b/src/app/[language]/layout.tsx @@ -4,7 +4,6 @@ import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.conf import { cookies } from "next/headers"; import { PREFERRED_THEME_COOKIE_KEY } from "@/features/themes/theme.config"; import { PageLayoutComponent } from "@/features/common/components/layout/page-layout/page-layout.component"; -import { UseHashWarningComponent } from "@/features/decoder/components/use-hash-warning/use-hash-warning.component"; import { PageMetadataProps } from "@/features/common/models/page-metadata.props"; import { getHomeDictionary } from "@/features/localization/services/language-dictionary.service"; import { generatePageMetadata } from "@/libs/metadata/metadata.service"; @@ -54,7 +53,6 @@ export default function RootLayout({ themeCode={initialThemeCookieValue} > {children} - ); } From 01e7d481cbc4b2544033114f2ab33d69556e85b5 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:29:48 -0500 Subject: [PATCH 03/22] delete hash warning call --- src/features/decoder/components/token-decoder.component.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 27faea8e..8aef18d0 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -50,9 +50,6 @@ export const TokenDecoderComponent: React.FC = ({ const loadDecoderInputs = useDecoderStore((state) => state.loadDecoderInputs); const handleJwtChange$ = useDecoderStore((state) => state.handleJwtChange); - const showUseHashWarning$ = useDecoderStore( - (state) => state.showUseHashWarning - ); useEffect(() => { const handleHashChange = () => { @@ -100,7 +97,6 @@ export const TokenDecoderComponent: React.FC = ({ const warning = searchParams.get(WARNING_PARAM_KEY); if (warning === WARNING_PARAM_VALUE) { - showUseHashWarning$(); searchParams.delete(WARNING_PARAM_KEY); @@ -128,7 +124,7 @@ export const TokenDecoderComponent: React.FC = ({ return () => { window.removeEventListener("hashchange", handleHashChange); }; - }, [handleJwtChange$, router, showUseHashWarning$]); + }, [handleJwtChange$, router]); useEffect(() => { if (isMounted.current) { From 25dbc973fd4696bcb0f1cfafa5c66b7a21ba0277 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:30:03 -0500 Subject: [PATCH 04/22] delete use hash warning --- .../use-hash-warning.component.tsx | 41 ------------- .../use-hash-warning.module.scss | 60 ------------------- 2 files changed, 101 deletions(-) delete mode 100644 src/features/decoder/components/use-hash-warning/use-hash-warning.component.tsx delete mode 100644 src/features/decoder/components/use-hash-warning/use-hash-warning.module.scss diff --git a/src/features/decoder/components/use-hash-warning/use-hash-warning.component.tsx b/src/features/decoder/components/use-hash-warning/use-hash-warning.component.tsx deleted file mode 100644 index 4e632ad8..00000000 --- a/src/features/decoder/components/use-hash-warning/use-hash-warning.component.tsx +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; - -import React from "react"; -import styles from "./use-hash-warning.module.scss"; -import { - HashWarningVisibilityValues, - useDecoderStore, -} from "@/features/decoder/services/decoder.store"; -import { getWarningsUiDictionary } from "@/features/localization/services/ui-language-dictionary.service"; - -interface UseHashWarningComponentProps { - languageCode: string; -} - -export const UseHashWarningComponent: React.FC< - UseHashWarningComponentProps -> = ({ languageCode }) => { - const useHashWarningVisibility = useDecoderStore( - (state) => state.useHashWarningVisibility, - ); - const hideUseHashWarning = useDecoderStore( - (state) => state.hideUseHashWarning, - ); - - const dictionary = getWarningsUiDictionary(languageCode); - - if (useHashWarningVisibility === HashWarningVisibilityValues.VISIBLE) { - return ( -
-
- - -
-
- ); - } - - return null; -}; diff --git a/src/features/decoder/components/use-hash-warning/use-hash-warning.module.scss b/src/features/decoder/components/use-hash-warning/use-hash-warning.module.scss deleted file mode 100644 index 0a26fabd..00000000 --- a/src/features/decoder/components/use-hash-warning/use-hash-warning.module.scss +++ /dev/null @@ -1,60 +0,0 @@ -@use "@/libs/theme/styles/variables" as *; -@use "@/libs/theme/styles/mixins" as *; - -.backdrop { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - position: fixed; - top: 0; - left: 0; - height: 100%; - width: 100%; - - z-index: 9999; - - backdrop-filter: blur(0.5rem); - - cursor: pointer; - - &[aria-hidden="false"] { - visibility: visible; - animation: fadeIn 0.2s linear; - } - - &[aria-hidden="true"] { - visibility: hidden; - } - - @media #{$breakpoint-dimension-xs} { - min-width: auto; - } -} - -.container { - position: fixed; - bottom: 2rem; - right: 2rem; - left: 2rem; - padding: 1.5rem 2rem; - background-color: var(--color_bg_state_danger_subtle); - color: var(--color_fg_on_state_danger_subtle); - border: 1px solid var(--color_border_state_danger); - z-index: 999; - font-size: 0.865rem; - border-radius: 0.5rem; -} - -.button { - background-color: transparent; - color: var(--color_fg_on_state_danger_subtle); - border: none; - position: absolute; - top: 0.25rem; - right: 0.75rem; - font-size: 1.5rem; - transform: rotate(45deg); - cursor: pointer; -} From f81142556de29c73bc898a764a42be8e28fb59e5 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 3 Dec 2025 12:59:46 -0500 Subject: [PATCH 05/22] remove hash from url --- .../components/token-decoder.component.tsx | 33 ++----------------- src/libs/config/project.constants.ts | 2 -- src/middleware.ts | 2 -- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 8aef18d0..381450ca 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -8,9 +8,7 @@ import { SecretKeyInputComponent } from "@/features/decoder/components/secret-ke import { useDecoderStore } from "@/features/decoder/services/decoder.store"; import { useRouter } from "next/navigation"; import { - SupportedTokenHashParamValues, - WARNING_PARAM_KEY, - WARNING_PARAM_VALUE, + SupportedTokenHashParamValues } from "@/libs/config/project.constants"; import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model"; import { ClaimDescriptionVisibilityValues } from "@/features/common/values/claim-description-visibility.values"; @@ -90,36 +88,9 @@ export const TokenDecoderComponent: React.FC = ({ }); }; - const handleWarning = () => { - const search = window.location.search; - - const searchParams = new URLSearchParams(search); - const warning = searchParams.get(WARNING_PARAM_KEY); - - if (warning === WARNING_PARAM_VALUE) { - - searchParams.delete(WARNING_PARAM_KEY); - - const currentUrl = window.location.href.split("?")[0]; - - let newUrl = `${currentUrl}`; - - if (searchParams.size > 0) { - newUrl += `?${searchParams.toString()}`; - } - - if (window.location.hash) { - newUrl += window.location.hash; - } - - router.push(newUrl); - } - }; - window.addEventListener("hashchange", handleHashChange); - + handleHashChange(); - handleWarning(); return () => { window.removeEventListener("hashchange", handleHashChange); diff --git a/src/libs/config/project.constants.ts b/src/libs/config/project.constants.ts index 3303d5a8..a056e52b 100644 --- a/src/libs/config/project.constants.ts +++ b/src/libs/config/project.constants.ts @@ -10,8 +10,6 @@ export enum SupportedTokenHashParamValues { ID_TOKEN = "id_token", VALUE = "value", } -export const WARNING_PARAM_KEY = "warning"; -export const WARNING_PARAM_VALUE = "use_hash"; export const EBOOK_URL = "https://auth0.com/resources/ebooks/jwt-handbook/?utm_source=jwtio&utm_medium=banner&utm_campaign=jwt-handbook"; diff --git a/src/middleware.ts b/src/middleware.ts index 5d321396..59a65306 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -48,8 +48,6 @@ export function middleware(request: NextRequest) { request.nextUrl.searchParams.delete("access_token"); request.nextUrl.searchParams.delete("value"); - request.nextUrl.searchParams.append("warning", "use_hash"); - request.nextUrl.hash = `token=${tokenParam}`; return NextResponse.redirect(request.nextUrl); From 8d06e9983191dab06bb9534e6aca733e7b03821e Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Mon, 8 Dec 2025 10:40:06 -0500 Subject: [PATCH 06/22] temp disable hashchange listeners --- src/features/decoder/components/token-decoder.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 381450ca..1ffe8bf2 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -88,12 +88,12 @@ export const TokenDecoderComponent: React.FC = ({ }); }; - window.addEventListener("hashchange", handleHashChange); + //window.addEventListener("hashchange", handleHashChange); handleHashChange(); return () => { - window.removeEventListener("hashchange", handleHashChange); + //window.removeEventListener("hashchange", handleHashChange); }; }, [handleJwtChange$, router]); From 0a10bc2a1a392cb552a037968012a303f2ada2d8 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:15:55 -0500 Subject: [PATCH 07/22] temporary logs --- .../decoder/components/token-decoder.component.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 1ffe8bf2..b0b76bcf 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -51,6 +51,7 @@ export const TokenDecoderComponent: React.FC = ({ useEffect(() => { const handleHashChange = () => { + console.count("hash handler fired") const hash = window.location.hash.substring(1); if (hash.includes("debugger-io?token=")) { @@ -67,7 +68,7 @@ export const TokenDecoderComponent: React.FC = ({ } const newUrl = `${currentUrl}#${SupportedTokenHashParamValues.TOKEN}=${token}`; - + console.log("Logging hash length before replacing///", token.length) window.location.replace(newUrl); return; @@ -88,12 +89,12 @@ export const TokenDecoderComponent: React.FC = ({ }); }; - //window.addEventListener("hashchange", handleHashChange); + window.addEventListener("hashchange", handleHashChange); handleHashChange(); return () => { - //window.removeEventListener("hashchange", handleHashChange); + window.removeEventListener("hashchange", handleHashChange); }; }, [handleJwtChange$, router]); From acdb533ea53f5587da06006f4a193d2cadbd7a90 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:43:38 -0500 Subject: [PATCH 08/22] temporary logs --- .../decoder/components/token-decoder.component.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index b0b76bcf..747b6481 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -75,15 +75,20 @@ export const TokenDecoderComponent: React.FC = ({ } if (!hash.includes("=")) { + console.log("hash not includes =") return; } - const hashParams = new URLSearchParams(hash); + + const hashParams = new URLSearchParams(hash); + console.log("Hash param keys!!!", hashParams) Object.values(SupportedTokenHashParamValues).forEach((hashParamKey) => { const token = hashParams.get(hashParamKey); if (token) { + console.count("handling jwt change") + console.log("The token is:///", token) handleJwtChange$(token); } }); From ab7d9e0ffe6809f3de73d23b64109491150c7a1c Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Mon, 8 Dec 2025 15:06:13 -0500 Subject: [PATCH 09/22] move middleware search param logic to client decoder --- .../components/token-decoder.component.tsx | 43 +++++++++++++------ src/middleware.ts | 4 +- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 747b6481..bba693aa 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -6,10 +6,8 @@ import { DecodedPayloadOutputComponent } from "@/features/decoder/components/dec import { JwtInputComponent } from "@/features/decoder/components/jwt-input.component"; import { SecretKeyInputComponent } from "@/features/decoder/components/secret-key-input.component"; import { useDecoderStore } from "@/features/decoder/services/decoder.store"; -import { useRouter } from "next/navigation"; -import { - SupportedTokenHashParamValues -} from "@/libs/config/project.constants"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { SupportedTokenHashParamValues } from "@/libs/config/project.constants"; import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model"; import { ClaimDescriptionVisibilityValues } from "@/features/common/values/claim-description-visibility.values"; import { useDebuggerStore } from "@/features/debugger/services/debugger.store"; @@ -41,6 +39,8 @@ export const TokenDecoderComponent: React.FC = ({ headlineConfig, }) => { const isMounted = useRef(false); + const searchParams = useSearchParams(); + const pathname = usePathname(); const router = useRouter(); @@ -51,8 +51,25 @@ export const TokenDecoderComponent: React.FC = ({ useEffect(() => { const handleHashChange = () => { - console.count("hash handler fired") - const hash = window.location.hash.substring(1); + const tokenParam = + searchParams.get("token") || + searchParams.get("id_token") || + searchParams.get("access_token") || + searchParams.get("value"); + const isHomePage = pathname === "/"; + const hash = tokenParam + ? `token=${tokenParam}` + : window.location.hash.substring(1); + + if (tokenParam && isHomePage) { + const currentParams = new URLSearchParams(searchParams.toString()); + currentParams.delete("token"); + currentParams.delete("id_token"); + currentParams.delete("access_token"); + currentParams.delete("value"); + router.replace(`${pathname}#${hash}`); + } + console.count("hash handler fired"); if (hash.includes("debugger-io?token=")) { const debugHash = window.location.hash @@ -68,34 +85,32 @@ export const TokenDecoderComponent: React.FC = ({ } const newUrl = `${currentUrl}#${SupportedTokenHashParamValues.TOKEN}=${token}`; - console.log("Logging hash length before replacing///", token.length) + console.log("Logging hash length before replacing///", token.length); window.location.replace(newUrl); return; } if (!hash.includes("=")) { - console.log("hash not includes =") + console.log("hash not includes ="); return; } - - const hashParams = new URLSearchParams(hash); - console.log("Hash param keys!!!", hashParams) + console.log("Hash param keys!!!", hashParams); Object.values(SupportedTokenHashParamValues).forEach((hashParamKey) => { const token = hashParams.get(hashParamKey); if (token) { - console.count("handling jwt change") - console.log("The token is:///", token) + console.count("handling jwt change"); + console.log("The token is:///", token); handleJwtChange$(token); } }); }; window.addEventListener("hashchange", handleHashChange); - + handleHashChange(); return () => { diff --git a/src/middleware.ts b/src/middleware.ts index 59a65306..4419a769 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -35,7 +35,7 @@ export function middleware(request: NextRequest) { return; } - const tokenParam = + /* const tokenParam = request.nextUrl.searchParams.get("token") || request.nextUrl.searchParams.get("id_token") || request.nextUrl.searchParams.get("access_token") || @@ -51,7 +51,7 @@ export function middleware(request: NextRequest) { request.nextUrl.hash = `token=${tokenParam}`; return NextResponse.redirect(request.nextUrl); - } + } */ const libraryFilter = request.nextUrl.searchParams.get("language"); const isLibrariesPage = pathname === "/libraries"; From 26465fe934d32661b55deb966218d8ee043108e6 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 11:41:18 -0500 Subject: [PATCH 10/22] remove temp logs --- .../components/token-decoder.component.tsx | 43 ++++++------------- src/middleware.ts | 4 +- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index bba693aa..747b6481 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -6,8 +6,10 @@ import { DecodedPayloadOutputComponent } from "@/features/decoder/components/dec import { JwtInputComponent } from "@/features/decoder/components/jwt-input.component"; import { SecretKeyInputComponent } from "@/features/decoder/components/secret-key-input.component"; import { useDecoderStore } from "@/features/decoder/services/decoder.store"; -import { usePathname, useRouter, useSearchParams } from "next/navigation"; -import { SupportedTokenHashParamValues } from "@/libs/config/project.constants"; +import { useRouter } from "next/navigation"; +import { + SupportedTokenHashParamValues +} from "@/libs/config/project.constants"; import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model"; import { ClaimDescriptionVisibilityValues } from "@/features/common/values/claim-description-visibility.values"; import { useDebuggerStore } from "@/features/debugger/services/debugger.store"; @@ -39,8 +41,6 @@ export const TokenDecoderComponent: React.FC = ({ headlineConfig, }) => { const isMounted = useRef(false); - const searchParams = useSearchParams(); - const pathname = usePathname(); const router = useRouter(); @@ -51,25 +51,8 @@ export const TokenDecoderComponent: React.FC = ({ useEffect(() => { const handleHashChange = () => { - const tokenParam = - searchParams.get("token") || - searchParams.get("id_token") || - searchParams.get("access_token") || - searchParams.get("value"); - const isHomePage = pathname === "/"; - const hash = tokenParam - ? `token=${tokenParam}` - : window.location.hash.substring(1); - - if (tokenParam && isHomePage) { - const currentParams = new URLSearchParams(searchParams.toString()); - currentParams.delete("token"); - currentParams.delete("id_token"); - currentParams.delete("access_token"); - currentParams.delete("value"); - router.replace(`${pathname}#${hash}`); - } - console.count("hash handler fired"); + console.count("hash handler fired") + const hash = window.location.hash.substring(1); if (hash.includes("debugger-io?token=")) { const debugHash = window.location.hash @@ -85,32 +68,34 @@ export const TokenDecoderComponent: React.FC = ({ } const newUrl = `${currentUrl}#${SupportedTokenHashParamValues.TOKEN}=${token}`; - console.log("Logging hash length before replacing///", token.length); + console.log("Logging hash length before replacing///", token.length) window.location.replace(newUrl); return; } if (!hash.includes("=")) { - console.log("hash not includes ="); + console.log("hash not includes =") return; } + + const hashParams = new URLSearchParams(hash); - console.log("Hash param keys!!!", hashParams); + console.log("Hash param keys!!!", hashParams) Object.values(SupportedTokenHashParamValues).forEach((hashParamKey) => { const token = hashParams.get(hashParamKey); if (token) { - console.count("handling jwt change"); - console.log("The token is:///", token); + console.count("handling jwt change") + console.log("The token is:///", token) handleJwtChange$(token); } }); }; window.addEventListener("hashchange", handleHashChange); - + handleHashChange(); return () => { diff --git a/src/middleware.ts b/src/middleware.ts index 4419a769..59a65306 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -35,7 +35,7 @@ export function middleware(request: NextRequest) { return; } - /* const tokenParam = + const tokenParam = request.nextUrl.searchParams.get("token") || request.nextUrl.searchParams.get("id_token") || request.nextUrl.searchParams.get("access_token") || @@ -51,7 +51,7 @@ export function middleware(request: NextRequest) { request.nextUrl.hash = `token=${tokenParam}`; return NextResponse.redirect(request.nextUrl); - } */ + } const libraryFilter = request.nextUrl.searchParams.get("language"); const isLibrariesPage = pathname === "/libraries"; From 231eac8d9f7eb2b616319d3feb24abda90df225c Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 11:41:29 -0500 Subject: [PATCH 11/22] add temp useeffect --- src/app/[language]/layout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/[language]/layout.tsx b/src/app/[language]/layout.tsx index 6335b3ca..21380bd3 100644 --- a/src/app/[language]/layout.tsx +++ b/src/app/[language]/layout.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect } from "react"; import { Metadata } from "next"; import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config"; import { cookies } from "next/headers"; @@ -47,6 +47,11 @@ export default function RootLayout({ const initialThemeCookieValue = sanitizedThemeCookieValue || ThemeCookieValues.SYSTEM_DARK; + useEffect(() => { + console.log("App mounted ounce"); + return () => console.log("App unmounted X") + },[]) + return ( Date: Tue, 9 Dec 2025 11:44:36 -0500 Subject: [PATCH 12/22] fix client issue --- src/app/[language]/layout.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/[language]/layout.tsx b/src/app/[language]/layout.tsx index 21380bd3..1b5949d7 100644 --- a/src/app/[language]/layout.tsx +++ b/src/app/[language]/layout.tsx @@ -1,3 +1,5 @@ +"use client" + import React, { useEffect } from "react"; import { Metadata } from "next"; import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config"; From e7dc5f48c92c5ea5af83af0a84494355e8bedc6b Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 11:46:56 -0500 Subject: [PATCH 13/22] remove temp useeffect --- src/app/[language]/layout.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/app/[language]/layout.tsx b/src/app/[language]/layout.tsx index 1b5949d7..dc6cb627 100644 --- a/src/app/[language]/layout.tsx +++ b/src/app/[language]/layout.tsx @@ -1,5 +1,3 @@ -"use client" - import React, { useEffect } from "react"; import { Metadata } from "next"; import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config"; @@ -49,11 +47,6 @@ export default function RootLayout({ const initialThemeCookieValue = sanitizedThemeCookieValue || ThemeCookieValues.SYSTEM_DARK; - useEffect(() => { - console.log("App mounted ounce"); - return () => console.log("App unmounted X") - },[]) - return ( Date: Tue, 9 Dec 2025 11:51:52 -0500 Subject: [PATCH 14/22] temp remove jwt editor --- src/features/decoder/components/jwt-input.component.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/features/decoder/components/jwt-input.component.tsx b/src/features/decoder/components/jwt-input.component.tsx index c906aae5..5a5902de 100644 --- a/src/features/decoder/components/jwt-input.component.tsx +++ b/src/features/decoder/components/jwt-input.component.tsx @@ -107,13 +107,6 @@ export const JwtInputComponent: React.FC = ({ ), }} > - {autoFocusEnabled !== undefined ? ( - - ) : null} ); From 3b5f793c50f389cae721b0435f9b4a18d805a25e Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:08:18 -0500 Subject: [PATCH 15/22] temp disable input component --- src/features/decoder/components/jwt-input.component.tsx | 7 +++++++ .../decoder/components/token-decoder.component.tsx | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/features/decoder/components/jwt-input.component.tsx b/src/features/decoder/components/jwt-input.component.tsx index 5a5902de..c906aae5 100644 --- a/src/features/decoder/components/jwt-input.component.tsx +++ b/src/features/decoder/components/jwt-input.component.tsx @@ -107,6 +107,13 @@ export const JwtInputComponent: React.FC = ({ ), }} > + {autoFocusEnabled !== undefined ? ( + + ) : null} ); diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 747b6481..9119b7f9 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -177,10 +177,7 @@ export const TokenDecoderComponent: React.FC = ({ description={dictionary.description} exampleGenerator={dictionary.exampleGenerator} contentInput={ - + <> } contentOutput={ <> From f625261ff659aa15e3177e28deda6f56abec1609 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:11:42 -0500 Subject: [PATCH 16/22] temp disable secret key --- .../decoder/components/token-decoder.component.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 9119b7f9..7485e976 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -177,7 +177,10 @@ export const TokenDecoderComponent: React.FC = ({ description={dictionary.description} exampleGenerator={dictionary.exampleGenerator} contentInput={ - <> + } contentOutput={ <> @@ -193,10 +196,10 @@ export const TokenDecoderComponent: React.FC = ({ decodedPayloadInitialTabId={decodedPayloadInitialTabId} descriptionVisibility={decodedPayloadDescriptionVisibility} /> - + /> */} } warnings={null} From e6968cca88e11c8192d819a6ce50f86f308cd5dc Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:17:45 -0500 Subject: [PATCH 17/22] temp remove content output --- src/features/decoder/components/token-decoder.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 7485e976..555f8ad2 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -184,7 +184,7 @@ export const TokenDecoderComponent: React.FC = ({ } contentOutput={ <> - = ({ decodedPayloadInitialTabId={decodedPayloadInitialTabId} descriptionVisibility={decodedPayloadDescriptionVisibility} /> - {/* */} From 276579489f6fed08c6ed0f6d06b30178c8697de1 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:30:19 -0500 Subject: [PATCH 18/22] temp disable token encoder and decoder --- .../debugger-widget.component.tsx | 32 ++++--------------- .../components/token-decoder.component.tsx | 4 +-- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx b/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx index 2cc687db..ea1e8b96 100644 --- a/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx +++ b/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx @@ -143,28 +143,8 @@ export const DebuggerWidgetComponent: React.FC< decoderDictionary={decoderDictionary} encoderDictionary={encoderDictionary} /> - {activeWidget$ === DebuggerWidgetValues.DECODER && ( - - )} - {activeWidget$ === DebuggerWidgetValues.ENCODER && ( - - )} + + ); @@ -172,7 +152,7 @@ export const DebuggerWidgetComponent: React.FC< return (
- + /> */} - + /> */}
); }; diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 555f8ad2..747b6481 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -184,7 +184,7 @@ export const TokenDecoderComponent: React.FC = ({ } contentOutput={ <> - {/* = ({ */} + /> } warnings={null} From 2386700dc95acfdb3910ed56a13c864b30923099 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 10 Dec 2025 12:46:34 -0500 Subject: [PATCH 19/22] temp disable assets component --- .../home/components/home-page/home-page.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/home/components/home-page/home-page.component.tsx b/src/features/home/components/home-page/home-page.component.tsx index eb24a20f..8118455f 100644 --- a/src/features/home/components/home-page/home-page.component.tsx +++ b/src/features/home/components/home-page/home-page.component.tsx @@ -143,7 +143,7 @@ export const HomePageComponent: React.FC = ({ // debuggerInitialMode={debuggerInitialMode} /> {/**/} From c16287f9c08494e92bb3c067aa2bc91cab31d74e Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:25:00 -0500 Subject: [PATCH 20/22] undo temp changes --- next.config.mjs | 1 + .../debugger-widget.component.tsx | 32 +++++++++++++++---- .../home-page/home-page.component.tsx | 4 +-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 8421cd46..3a9d9201 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,6 +2,7 @@ import createMDX from "@next/mdx"; /** @type {import('next').NextConfig} */ const nextConfig = { + productionBrowserSourceMaps: true, webpack(config) { config.module.rules.push( { diff --git a/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx b/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx index ea1e8b96..2cc687db 100644 --- a/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx +++ b/src/features/debugger/components/debugger-widget/debugger-widget.component.tsx @@ -143,8 +143,28 @@ export const DebuggerWidgetComponent: React.FC< decoderDictionary={decoderDictionary} encoderDictionary={encoderDictionary} /> - - + {activeWidget$ === DebuggerWidgetValues.DECODER && ( + + )} + {activeWidget$ === DebuggerWidgetValues.ENCODER && ( + + )} ); @@ -152,7 +172,7 @@ export const DebuggerWidgetComponent: React.FC< return (
- {/* */} + /> - {/* */} + />
); }; diff --git a/src/features/home/components/home-page/home-page.component.tsx b/src/features/home/components/home-page/home-page.component.tsx index 8118455f..eb24a20f 100644 --- a/src/features/home/components/home-page/home-page.component.tsx +++ b/src/features/home/components/home-page/home-page.component.tsx @@ -143,7 +143,7 @@ export const HomePageComponent: React.FC = ({ // debuggerInitialMode={debuggerInitialMode} /> {/**/} From cbbc059a3ad6ebbcdd1dee73e8d6745fc1ae9126 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:24:44 -0500 Subject: [PATCH 21/22] remove temp logs --- src/features/decoder/components/token-decoder.component.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/features/decoder/components/token-decoder.component.tsx b/src/features/decoder/components/token-decoder.component.tsx index 747b6481..b640d021 100644 --- a/src/features/decoder/components/token-decoder.component.tsx +++ b/src/features/decoder/components/token-decoder.component.tsx @@ -68,27 +68,21 @@ export const TokenDecoderComponent: React.FC = ({ } const newUrl = `${currentUrl}#${SupportedTokenHashParamValues.TOKEN}=${token}`; - console.log("Logging hash length before replacing///", token.length) window.location.replace(newUrl); - return; } if (!hash.includes("=")) { - console.log("hash not includes =") return; } const hashParams = new URLSearchParams(hash); - console.log("Hash param keys!!!", hashParams) Object.values(SupportedTokenHashParamValues).forEach((hashParamKey) => { const token = hashParams.get(hashParamKey); if (token) { - console.count("handling jwt change") - console.log("The token is:///", token) handleJwtChange$(token); } }); From 567019f965ad33f1bd4de1e05d9ee4f752c9c7a8 Mon Sep 17 00:00:00 2001 From: Javier Tinoco <213990346+javiert-okta@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:24:58 -0500 Subject: [PATCH 22/22] update latest changes on main --- .github/workflows/production.yaml | 2 +- src/app/[language]/layout.tsx | 2 +- src/app/sitemap.ts | 23 ++++++++++++++++++- .../adobe-analytics-script.component.tsx | 10 ++++++++ .../components/shell/shell.component.tsx | 2 ++ 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/features/analytics/components/adobe-analytics-script.component.tsx diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index ab6f8cf0..adca8ecb 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -28,7 +28,7 @@ jobs: run: npx playwright install --with-deps - name: Run Playwright Tests - run: npx playwright test + run: NODE_OPTIONS="--no-experimental-strip-types" npx playwright test - name: Upload Playwright Traces if: failure() diff --git a/src/app/[language]/layout.tsx b/src/app/[language]/layout.tsx index dc6cb627..6335b3ca 100644 --- a/src/app/[language]/layout.tsx +++ b/src/app/[language]/layout.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React from "react"; import { Metadata } from "next"; import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config"; import { cookies } from "next/headers"; diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index fcce47f3..70a1b8b0 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -6,14 +6,35 @@ export default function sitemap(): MetadataRoute.Sitemap { { url: BASE_URL, lastModified: new Date(), + alternates: { + languages: { + en: `${BASE_URL}/`, + ja: `${BASE_URL}/ja/`, + "x-default": `${BASE_URL}/`, + }, + }, }, { url: `${BASE_URL}/introduction`, lastModified: new Date(), + alternates: { + languages: { + en: `${BASE_URL}/introduction`, + ja: `${BASE_URL}/ja/introduction`, + "x-default": `${BASE_URL}/introduction`, + }, + }, }, { url: `${BASE_URL}/libraries`, lastModified: new Date(), + alternates: { + languages: { + en: `${BASE_URL}/libraries`, + ja: `${BASE_URL}/ja/libraries`, + "x-default": `${BASE_URL}/libraries`, + }, + }, }, ]; -} +} \ No newline at end of file diff --git a/src/features/analytics/components/adobe-analytics-script.component.tsx b/src/features/analytics/components/adobe-analytics-script.component.tsx new file mode 100644 index 00000000..759cb1e7 --- /dev/null +++ b/src/features/analytics/components/adobe-analytics-script.component.tsx @@ -0,0 +1,10 @@ +import Script from 'next/script'; + +const AdobeAnalyticsScript = () => { + const source = process.env.NEXT_PUBLIC_ADOBE_ANALYTICS_URL; + return source ? ( + + ) : null; +}; + +export default AdobeAnalyticsScript; \ No newline at end of file diff --git a/src/features/common/components/shell/shell.component.tsx b/src/features/common/components/shell/shell.component.tsx index 4cc03ed2..4e1e8d59 100644 --- a/src/features/common/components/shell/shell.component.tsx +++ b/src/features/common/components/shell/shell.component.tsx @@ -26,6 +26,7 @@ import { import { ThemeDetectorComponent } from "@/features/common/components/theme-detector/theme-detector.component"; import { ThemeCookieValues } from "@/features/common/values/theme.values"; import { AbTestingScriptComponent } from "@/features/analytics/components/ab-testing-script/ab-testing-script.component"; +import AdobeAnalyticsScript from "@/features/analytics/components/adobe-analytics-script.component"; const GTM_ID = process.env.NEXT_PUBLIC_GTM_ID; @@ -105,6 +106,7 @@ export const ShellComponent: React.FC = ({ + {children} {consentLevel && consentLevel.includes(COOKIE_LEVELS.NECESSARY.toString()) &&