-
-
Notifications
You must be signed in to change notification settings - Fork 964
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: return verification flow ID after registration flow #3144
feat: return verification flow ID after registration flow #3144
Conversation
c125149
to
5e64e93
Compare
0e4f251
to
1da0e40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looking pretty good 👍
What other actions do we expect to be added?
Codecov Report
@@ Coverage Diff @@
## master #3144 +/- ##
==========================================
+ Coverage 77.62% 77.66% +0.04%
==========================================
Files 317 319 +2
Lines 20046 20110 +64
==========================================
+ Hits 15561 15619 +58
- Misses 3292 3296 +4
- Partials 1193 1195 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
For the recovery flow, we could use this and add For the various Then we will also have a special one for OIDC. |
d45195a
to
4c7f9cf
Compare
// registration. | ||
// | ||
// required: false | ||
// swagger:ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we aren't returning the registration flow itself, once the registration finishes, this is just used internally, and should not be sent to the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the required field, and swagger ignore. json:"-"
already omits it from swagger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
4c7f9cf
to
cf9c1d9
Compare
{ | ||
"attributes": { | ||
"disabled": false, | ||
"name": "csrf_token", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if re-ordering CSRF token "inputs" will be an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not matter.
cf9c1d9
to
22a143a
Compare
e48561a
to
9e986f3
Compare
As for E2E tests, right now they (should be) are passing, because the changes are not breaking. We are merely adding new fields to payloads. I would propose, adding this feature to the reference implementations, once this is merged and adjusting the E2E tests, once that's done. That way we don't need to update the SDK from a branch, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
{ | ||
"attributes": { | ||
"disabled": false, | ||
"name": "csrf_token", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This looks really good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First sweep
selfservice/flow/continue_with.go
Outdated
// Flow contains the ID of the verification flow | ||
// | ||
// required: true | ||
Flow struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a dedicated struct for this and give it a swagger:model
annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names get quite long. Would've liked to avoid those.. But fine with me, done.
// registration. | ||
// | ||
// required: false | ||
// swagger:ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the required field, and swagger ignore. json:"-"
already omits it from swagger
add0917
to
468484a
Compare
Is this good to review? |
If CI is green, yes from my POV. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking grand! The only thing I'm missing is some proof that continue_with works as intended. Basically, this means an end to end test with registration + verification on mobile and/or SPA?
468484a
to
d21afcb
Compare
Yes, that's true. I wanted to merge this first and write some E2E tests then, to avoid the SDK release-dance needed to update both. But I can do that before we merge this PR. |
Yes please do that first :) For the SDK - do you know how this works? |
No :) |
Make sure to have the paths set correctly, and you'll also need access to the npm package - if you give me your ID i can add you |
d21afcb
to
6ffe86c
Compare
.github/workflows/ci.yaml
Outdated
with: | ||
repository: ory/kratos-selfservice-ui-react-nextjs | ||
path: react-ui | ||
ref: jonas-jonas/feat/showVerificationAfterRegistration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
e9462d3
to
0037f09
Compare
0037f09
to
e87ddef
Compare
e87ddef
to
8169ac2
Compare
assert.IsType(t, &flow.ContinueWithVerificationUI{}, vf) | ||
fView := vf.(*flow.ContinueWithVerificationUI).Flow | ||
|
||
expectedVerificationFlow, err := reg.VerificationFlowPersister().GetVerificationFlow(ctx, fView.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test assertion changed - previously we synthetically created a new verification URL and compared that with the assertion from the DB. Now we fetch both verification flows from the DB and compare them. Is this still a useful test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean removing https://github.com/ory/kratos/pull/3144/files/8169ac2945655590e9210777cf26b7766da2c4a5#diff-24ee502b250d67d70d70ba02ad18f303654b9af76552128958425b1c9043cc18R97-R100? I think that would still be fine, indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
switch k { | ||
case "settings": | ||
originalFlow = &settings.Flow{RequestURL: "http://foo.com/settings?after_verification_return_to=verification_callback"} | ||
case "register": | ||
originalFlow = ®istration.Flow{RequestURL: "http://foo.com/registration?after_verification_return_to=verification_callback"} | ||
default: | ||
t.FailNow() | ||
} | ||
require.NoError(t, hf(h, i, originalFlow)) | ||
expectedVerificationFlow, err = verification.NewPostHookFlow(conf, conf.SelfServiceFlowVerificationRequestLifespan(ctx), "", u, s, originalFlow) | ||
|
||
assert.Emptyf(t, originalFlow.ContinueWith(), "%+v", originalFlow.ContinueWith()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understand what this is doing - you're creating a new original flow and then checking whether it has continue with. That of course will be true, because it's not added in the switch statement.
OR is hf()
somehow setting that value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hf
is executing the verification hook, which persists the verification flow, and since all verifiable addresses are now verified, we expect no continue_with
items anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test could use some cleanup, for sure. But OOS of this PR IMO.
231ec43
to
c6c26e3
Compare
Related issue(s)
Closes #2975
Checklist
Discuss, how an E2E test for this could look?See feat: return verification flow ID after registration flow #3144 (comment)Better way to pass data from the hook executors back to the handler?We attached it to the flow object which is modified by other hooks, anyway.