network
network copied to clipboard
onSubmit never called when using passwordless one-time codes
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [X] I have joined the Ory Community Slack.
- [X] I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
When using ory elements UserAuthCard and only offering the passwordless one-time code the onSubmit method of the UserAuthCard is never called. I use a custom domain and I have disabled the ory account experience. What happens is that the {custom domain ory api endpoint url}/registration?flow=flow-id is opened, which in turn redirects to the {my custom domain website}/registration?flow=flow-id url. The onSubmit function is never called and I loose all query params like return_to in the process.
Reproducing the bug
Setup a web project which only offers passwordless one-time codes. Use ory elements and the UserAuthCard. Setup a custom domain. Write your email and click "sign up with code". The redirect is triggered. Should: not trigger any redirect, just trigger the onSubmit function.
Relevant log output
No response
Relevant configuration
No response
Version
"@ory/client": "^1.9.0", "@ory/elements": "^0.2.0", "@ory/integrations": "^1.1.5",
On which operating system are you observing this issue?
Ory Network
In which environment are you deploying?
Ory Network
Additional Context
next.js, react, typescript
Follow up: When using a setup like this:
<UserAuthForm ...>
<AuthCodeSection nodes={flow.ui.nodes} />
</UserAuthForm>
instead of a
<UserAuthCard .../>
then the problem is gone and onSubmit is called.
Thank you for the report - we are working on a GA version of Ory Elements (breaking changes to be expected ...) which has a much better designed API, support for SSR, and many more features common in today's react ecosystem. It is therefore unlikely that we will resolve this issue in the current Ory Elements version but would accept PRs to fix it.
The current ory elements version will then go into maintenance mode where no new features are added but if important bugs or security issues exist, they would be resolved.