From a01481e385850495ff9ba17fafd9b756add937a2 Mon Sep 17 00:00:00 2001 From: Gianluca Spada Date: Thu, 26 Sep 2024 16:40:31 +0200 Subject: [PATCH] fix: [SIW-1681] Change pattern to find the CIE authentication link (#142) --- src/cie/component.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cie/component.tsx b/src/cie/component.tsx index 664ed881..17d05061 100644 --- a/src/cie/component.tsx +++ b/src/cie/component.tsx @@ -12,6 +12,8 @@ import type { import { startCieAndroid, startCieiOS, type ContinueWithUrl } from "./manager"; import { CieError, CieErrorType } from "./error"; +const AUTH_LINK_PATTERN = "lettura carta"; + /* To obtain the authentication URL on CIE L3 it is necessary to take the * link contained in the "Entra con lettura carta CIE" button. * This link can then be used on CieManager. @@ -21,7 +23,7 @@ const injectedJavaScript = ` (function() { function sendDocumentContent() { const idpAuthUrl = [...document.querySelectorAll("a")] - .filter(a => a.textContent.includes("lettura carta CIE")) + .filter(a => a.textContent.toLowerCase().includes("${AUTH_LINK_PATTERN}")) .map(a=>a.href)[0]; if(idpAuthUrl) {