diff --git a/src/components/Common/MultiFactorAuthentication.tsx b/src/components/Common/MultiFactorAuthentication.tsx index 42ac2dffb..280a25eef 100644 --- a/src/components/Common/MultiFactorAuthentication.tsx +++ b/src/components/Common/MultiFactorAuthentication.tsx @@ -439,8 +439,8 @@ function SecurityKeyTable({ handleVerifyWebauthnTokenBankID, handleVerifyWebauth })(); }, [authn?.response?.frontend_action]); - async function handleConfirmDeleteModal(credential_key: string) { - credentialKey.current = credential_key; + async function handleConfirmDeleteModal(cred: CredentialType) { + credentialKey.current = JSON.stringify({ credential: cred.key, description: cred.description }); // Test if the user can directly execute the action or a re-auth security zone will be required // If no re-auth is required, then show the modal to confirm the removal // else show the re-auth modal and do now show the confirmation modal (show only 1 modal) @@ -454,13 +454,14 @@ function SecurityKeyTable({ handleVerifyWebauthnTokenBankID, handleVerifyWebauth async function handleRemoveWebauthnToken() { setShowConfirmRemoveSecurityKeyModal(false); - const response = await dispatch(removeWebauthnToken({ credential_key: credentialKey.current as string })); + const parsedFrontendState = credentialKey.current && JSON.parse(credentialKey.current); + const response = await dispatch(removeWebauthnToken({ credential_key: parsedFrontendState.credential as string })); if (removeWebauthnToken.rejected.match(response)) { // prepare authenticate() and AuthenticateModal dispatch( authnSlice.actions.setFrontendActionAndState({ frontend_action: "removeSecurityKeyAuthn", - frontend_state: credentialKey.current as string, + frontend_state: JSON.stringify(parsedFrontendState), }) ); } @@ -531,7 +532,7 @@ function SecurityKeyTable({ handleVerifyWebauthnTokenBankID, handleVerifyWebauth id="remove-webauthn" buttonstyle="remove" size="sm" - onClick={() => handleConfirmDeleteModal(cred.key)} + onClick={() => handleConfirmDeleteModal(cred)} >
diff --git a/src/components/Dashboard/AuthenticateModal.tsx b/src/components/Dashboard/AuthenticateModal.tsx index ddb9ebfd9..3068c150b 100644 --- a/src/components/Dashboard/AuthenticateModal.tsx +++ b/src/components/Dashboard/AuthenticateModal.tsx @@ -61,7 +61,7 @@ export function AuthenticateModal() { defaultMessage="You need to log in again to perform the requested action." />
- {securityKeyDescription && ( + {frontend_action === "verifyCredentials" && (

)} + {frontend_action === "removeSecurityKeyAuthn" && ( +

+ {securityKeyDescription}, + }} + /> +

+ )} + {frontend_action === "removeIdentity" && ( +

+ +

+ )} } showModal={re_authenticate} diff --git a/src/translation/extractedMessages.json b/src/translation/extractedMessages.json index f357011a6..0721088dd 100644 --- a/src/translation/extractedMessages.json +++ b/src/translation/extractedMessages.json @@ -318,6 +318,10 @@ "developer_comment": "login eduid - other devices list item 3", "string": "on that second device, review the device requesting to be logged in and use the presented code to login by entering it within the time shown, in the first device." }, + "54jpQ0": { + "developer_comment": "security zone modal", + "string": "Note: Your security key {securityKeyDescription} will be removed after you log in." + }, "56tvVG": { "developer_comment": "which verification methods - paragraph2", "string": "Note: you can remove a verified identity connected to your eduID in the Identity area." @@ -1667,6 +1671,10 @@ "developer_comment": "how to contact support phone", "string": ", but for simple matters you can also reach us on phone number" }, + "b7rKTd": { + "developer_comment": "security zone modal", + "string": "Note: continuing will disconnect your real identity from your eduID after you log in." + }, "bCY5Fs": { "developer_comment": "Use another device IP proximity", "string": "(Close to your address now)"