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

profile:back button method not working #4010

Open
5 tasks done
blitss opened this issue Jul 20, 2024 · 2 comments
Open
5 tasks done

profile:back button method not working #4010

blitss opened this issue Jul 20, 2024 · 2 comments
Labels
bug Something is not working.

Comments

@blitss
Copy link

blitss commented Jul 20, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

So apparently two stage sign up introduces a new UI node which is a "back button":

{
        "type": "input",
        "group": "profile",
        "attributes": {
          "name": "method",
          "type": "submit",
          "value": "profile:back",
          "disabled": false,
          "node_type": "input"
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1040008,
            "text": "Back",
            "type": "info"
          }
        }
      }

But the problem is profile:back method is not exposed in OpenAPI specs, not supported by API and hence not available in clients. Even calling it directly via API doesn't do anything, although I think it should be implemented (https://github.com/ory/kratos/blob/master/selfservice/strategy/profile/two_step_registration.go#L130):

 curl 'http://localhost:3000/api/.ory/self-service/registration?flow=6052dc7f-7fa0-4979-8df2-96b58c25f005'
...
 --data-raw '{"csrf_token":"....","method":"profile:back"}' | jq

Outputs the same form for credential selection. Tested with Typescript SDK, that's something you're unable to do:

await sdk.updateRegistrationFlow({
        flow: flow!.id,
        updateRegistrationFlowBody: {
          method: 'profile:back',
        },
      })

Reproducing the bug

Try using the back button in second stage of sign up

Relevant log output

No response

Relevant configuration

No response

Version

image: oryd/kratos:v1.2.0

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker

Additional Context

No response

@blitss blitss added the bug Something is not working. label Jul 20, 2024
@christoph-kluge
Copy link

christoph-kluge commented Aug 31, 2024

I had the same issue. Please check/send all required traits as well with the profile:back.

There is an integration test for it here and the code does also support profile:back here. What I found out is that there is an early exit here which is handled when decoding (and validating) is not possible. Checking /registration/flows?id={flowId} showed me that the email trait was missing.

So before the fix my payload contained only this:

csrf_token: {token}
method: profile:back

After fixing my cusotm ui with all traits it started to work.

traits.email: [email protected]
traits.name.first: john
traits.name.last: doe
csrf_token: {token}
method: profile:back

@blitss
Copy link
Author

blitss commented Sep 1, 2024

I had the same issue. Please check/send all required traits as well with the profile:back.

Yeah nice find figured that too eventually.

tbh I'm going to migrate off Kratos because although the idea of auth ecosystem is good the Kratos itself strikes me as very unpolished product. Had too much moments where I just had to look at what's going on in the Kratos code internally (shining example is - try to mark users signing with google account as verified in kratos) since docs are more focused on their SaaS offering.

Maybe it's fine when you use their integrated UIs but when you try to build your own React/SPA UI it's a nightmare and there aren't good examples you can follow; also typescript library is broken and isn't completely typed.

Currently I'm trying to deal with issue where settings flow appears only in 1 out of 6-8 cases (otherwise - it's just empty response, literally nothing and 200 resp code) and that's just stupid

And maintainers obv don't even look at the issues.

I guess all that funding and 4 yrs of development didn't help to create a good auth offering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants