From d13cc5e9410ae3cead78957f6d531209796b0a6a Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:55:00 +0200 Subject: [PATCH] feat: recovery and verification on code submit stories --- src/stories/Ory/Auth.stories.tsx | 19 ++++ .../Ory/recovery-code-submit-flow.json | 106 ++++++++++++++++++ .../Ory/verification-code-submit-flow.json | 106 ++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 src/stories/Ory/recovery-code-submit-flow.json create mode 100644 src/stories/Ory/verification-code-submit-flow.json diff --git a/src/stories/Ory/Auth.stories.tsx b/src/stories/Ory/Auth.stories.tsx index 93343fd6e..c3e58e59a 100644 --- a/src/stories/Ory/Auth.stories.tsx +++ b/src/stories/Ory/Auth.stories.tsx @@ -24,9 +24,11 @@ import registrationFlow from "./register-flow.json" import registrationFlowCode from "./register-flow-code.json" import recoveryFlow from "./recovery-flow.json" +import recoveryCodeSubmitFlow from "./recovery-code-submit-flow.json" import verificationFlow from "./verification-flow.json" import verificationSubmitted from "./verification-submit-flow.json" +import verificationCodeSubmitFlow from "./verification-code-submit-flow.json" import logo from "../assets/logo.svg" @@ -208,6 +210,13 @@ RecoveryAuthCardWithoutAdditionalProps.args = { flowType: "recovery", } +export const RecoveryAuthCardCodeSubmit = Template.bind({}) + +RecoveryAuthCardCodeSubmit.args = { + flow: recoveryCodeSubmitFlow as RecoveryFlow, + flowType: "recovery", +} + export const RegistrationAuthCardFlowCode = Template.bind({}) RegistrationAuthCardFlowCode.args = { flow: registrationFlowCode as RegistrationFlow, @@ -240,3 +249,13 @@ VerificationAuthCardWithoutAdditionalProps.args = { flow: verificationFlow as VerificationFlow, flowType: "verification", } + +export const VerificationAuthCardCodeSubmit = Template.bind({}) + +VerificationAuthCardCodeSubmit.args = { + flow: verificationCodeSubmitFlow as VerificationFlow, + flowType: "verification", + additionalProps: { + signupURL: "https://acme.com/login", + }, +} diff --git a/src/stories/Ory/recovery-code-submit-flow.json b/src/stories/Ory/recovery-code-submit-flow.json new file mode 100644 index 000000000..d588a392b --- /dev/null +++ b/src/stories/Ory/recovery-code-submit-flow.json @@ -0,0 +1,106 @@ +{ + "id": "81b5a86d-79ef-4ab5-be52-9623b4309ffc", + "type": "browser", + "expires_at": "2023-09-18T13:45:08.228419Z", + "issued_at": "2023-09-18T12:45:08.228419Z", + "request_url": "https://brave-mclean-yf1idvgo2x.projects.oryapis:8080/self-service/recovery/browser?return_to=", + "active": "code", + "ui": { + "action": "https://brave-mclean-yf1idvgo2x.projects.oryapis:8080/self-service/recovery?flow=81b5a86d-79ef-4ab5-be52-9623b4309ffc", + "method": "POST", + "nodes": [ + { + "type": "input", + "group": "default", + "attributes": { + "name": "csrf_token", + "type": "hidden", + "value": "RgBW3EcRaTq1xmfks3CoSSjsDnQvF6lKhYR7XIoqx1yeu2ajlzfxDk3BzrmyN+fn8qMnI4A4Fq/ik0BsSTkUpQ==", + "required": true, + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": {} + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "code", + "type": "text", + "required": true, + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070010, + "text": "Recovery code", + "type": "info" + } + } + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "method", + "type": "hidden", + "value": "code", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": {} + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "method", + "type": "submit", + "value": "code", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070005, + "text": "Submit", + "type": "info" + } + } + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "email", + "type": "submit", + "value": "alano@ory.sh", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070008, + "text": "Resend code", + "type": "info" + } + } + } + ], + "messages": [ + { + "id": 1060003, + "text": "An email containing a recovery code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and make sure to use the address you registered with.", + "type": "info" + } + ] + }, + "state": "sent_email" +} diff --git a/src/stories/Ory/verification-code-submit-flow.json b/src/stories/Ory/verification-code-submit-flow.json new file mode 100644 index 000000000..a09e2c784 --- /dev/null +++ b/src/stories/Ory/verification-code-submit-flow.json @@ -0,0 +1,106 @@ +{ + "id": "b12b9988-779b-49cd-8049-2982a9001160", + "type": "browser", + "expires_at": "2023-09-18T12:28:57.16341Z", + "issued_at": "2023-09-18T11:28:57.16341Z", + "request_url": "http://localhost:4000/self-service/verification/browser?return_to=", + "active": "code", + "ui": { + "action": "http://localhost:4000/self-service/verification?flow=b12b9988-779b-49cd-8049-2982a9001160", + "method": "POST", + "nodes": [ + { + "type": "input", + "group": "code", + "attributes": { + "name": "method", + "type": "hidden", + "value": "code", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": {} + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "code", + "type": "text", + "required": true, + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070011, + "text": "Verification code", + "type": "info" + } + } + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "method", + "type": "submit", + "value": "code", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070005, + "text": "Submit", + "type": "info" + } + } + }, + { + "type": "input", + "group": "default", + "attributes": { + "name": "csrf_token", + "type": "hidden", + "value": "/v35GnNEyEFtf5joZRKHf5IFZb7Z45/hSyynaKU8GaxNt8mfgnMDgPZlNTPmXfZ1Ebvqt8C/4b5ytfDxoHoNQA==", + "required": true, + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": {} + }, + { + "type": "input", + "group": "code", + "attributes": { + "name": "email", + "type": "submit", + "value": "test@test.com", + "disabled": false, + "node_type": "input" + }, + "messages": [], + "meta": { + "label": { + "id": 1070008, + "text": "Resend code", + "type": "info" + } + } + } + ], + "messages": [ + { + "id": 1080003, + "text": "An email containing a verification code has been sent to the email address you provided. If you have not received an email, check the spelling of the address and make sure to use the address you registered with.", + "type": "info" + } + ] + }, + "state": "sent_email" +}