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

fix: load return_to and append to errors #2333

Merged
merged 22 commits into from
Mar 28, 2022

Conversation

jacoblehr
Copy link
Contributor

This merge request fixes the way that return_to urls are set on the self service flow objects; previously, this was only being set when marshalling the flow to JSON; I have added a call to set this when the flow is retrieved from the database. This means that the return_to can be appended to each of the error responses in the event that the flow is expired. There is an existing pull request that fixes this for the verification flow (I'm actually a colleague of the original submitter MilesNorton) but I think it's better in this case to fix all of these at once.

Related pull requests

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

N/A

@CLAassistant
Copy link

CLAassistant commented Mar 22, 2022

CLA assistant check
All committers have signed the CLA.

@jacoblehr jacoblehr changed the title Fix: Load return_to and append to errors fix: load return_to and append to errors Mar 22, 2022
@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #2333 (5b5ff55) into master (52c9824) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2333      +/-   ##
==========================================
- Coverage   76.68%   76.64%   -0.04%     
==========================================
  Files         318      318              
  Lines       17368    17211     -157     
==========================================
- Hits        13319    13192     -127     
+ Misses       3109     3087      -22     
+ Partials      940      932       -8     
Impacted Files Coverage Δ
selfservice/flow/error.go 100.00% <100.00%> (ø)
selfservice/flow/login/flow.go 96.92% <100.00%> (+0.25%) ⬆️
selfservice/flow/login/handler.go 80.72% <100.00%> (-0.16%) ⬇️
selfservice/flow/recovery/flow.go 94.20% <100.00%> (+0.45%) ⬆️
selfservice/flow/recovery/handler.go 62.50% <100.00%> (-3.68%) ⬇️
selfservice/flow/registration/flow.go 100.00% <100.00%> (ø)
selfservice/flow/registration/handler.go 78.57% <100.00%> (-0.10%) ⬇️
selfservice/flow/settings/flow.go 94.02% <100.00%> (+0.48%) ⬆️
selfservice/flow/settings/handler.go 68.91% <100.00%> (-2.76%) ⬇️
selfservice/flow/verification/flow.go 90.12% <100.00%> (+0.64%) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52c9824...5b5ff55. Read the comment docs.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for your contribution! This looks pretty good and I have some ideas how to improve it further :)

selfservice/flow/login/handler.go Outdated Show resolved Hide resolved
selfservice/flow/verification/handler.go Show resolved Hide resolved
persistence/sql/persister_verification.go Outdated Show resolved Hide resolved
selfservice/flow/settings/handler.go Outdated Show resolved Hide resolved
@jacoblehr
Copy link
Contributor Author

Thanks for your feedback @aeneasr - good suggestions all round 😄

I'll work on the suggested improvements and update the PR

@aeneasr
Copy link
Member

aeneasr commented Mar 25, 2022

Could you please resolve the CI issues? :)

https://github.com/ory/kratos/runs/5676532411?check_suite_focus=true#step:13:41

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the PR using pop's callbacks which is a bit more save as they will always run :)

As noted in one of the comments, could you pelase add tests for these? A good indicator of whether tests are effective is to see if they pass when you comment your fixes. If they do pass there as well, they are not effective (as they do not test your changes but something else).

selfservice/flow/login/handler_test.go Show resolved Hide resolved
@aeneasr aeneasr self-assigned this Mar 28, 2022
@aeneasr aeneasr merged commit 5efe4a3 into ory:master Mar 28, 2022
harnash pushed a commit to Wikia/kratos that referenced this pull request Mar 28, 2022
Closes ory#2275
Closes ory#2279
Closes ory#2285

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
@vinckr
Copy link
Member

vinckr commented Mar 31, 2022

Hello @jacoblehr
Congrats on merging your first PR in Ory 🎉 !
Your contribution will soon be helping secure millions of identities around the globe 🌏.
As a small token of appreciation we send all our first time contributors a gift package to welcome them to the community.
Please drop me an email and I will forward you the form to claim your Ory swag!

peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this pull request Jun 30, 2023
Closes ory#2275
Closes ory#2279
Closes ory#2285

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants