Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: recovery and verification on code submit stories #144

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/stories/Ory/Auth.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
},
}
106 changes: 106 additions & 0 deletions src/stories/Ory/recovery-code-submit-flow.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"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"
}
106 changes: 106 additions & 0 deletions src/stories/Ory/verification-code-submit-flow.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"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"
}
Loading