Subject: Custom Login Flow with Ory: Encountering 422 Errors #131
Unanswered
LandSprutte
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
We are currently using Ory primarily as an identity provider to manage our users across various products for our customers. Overall, we have been satisfied with the out-of-the-box solutions provided by Ory. However, as our products evolve, we are exploring more customized solutions to better meet our customers' unique needs.
We are experimenting with self-served UI integration using custom flows in a React.js Single Page Application (SPA) that is statically served with Bun as a bundler. However, we are running into a challenge when trying to handle the login flow. Specifically, when we submit our form from the locally served UI (localhost:3000), we receive a 422 error.
As outlined in the Ory documentation, we understand that redirection is required for handling the 422 errors. Here is an example of the redirect URL we receive:
Interestingly, when I copy this link into my browser, I am redirected successfully and arrive at my main application (localhost:5173) with a valid session. However, when I programmatically assign window.location to the redirect URL, I encounter a 502 error for the /ui/consent?... endpoint.
Below is a snippet of the relevant code handling the update login flow:
Questions:
I appreciate any insights or suggestions you may have. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions