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: remove http.Redirect from show_verification_ui hook #3238

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

jonas-jonas
Copy link
Member

@jonas-jonas jonas-jonas commented Apr 17, 2023

With the current implementation, the session cookie would not be sent to the client if the session hook is set after the show_verification_ui hook.
The problem is, that show_verification_ui called http.Redirect, which internally calls http.WriteHeader(...), which then disregards all http.SetCookie calls after that.

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 the approval (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

aeneasr
aeneasr previously approved these changes Apr 17, 2023
@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Merging #3238 (0c0ee55) into master (523b93f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 0c0ee55 differs from pull request most recent head 8e80d76. Consider uploading reports for the commit 8e80d76 to get more accurate results

@@           Coverage Diff           @@
##           master    #3238   +/-   ##
=======================================
  Coverage   77.90%   77.90%           
=======================================
  Files         319      319           
  Lines       20447    20449    +2     
=======================================
+ Hits        15929    15931    +2     
  Misses       3320     3320           
  Partials     1198     1198           
Impacted Files Coverage Δ
selfservice/flow/registration/flow.go 97.10% <ø> (ø)
selfservice/flow/registration/hook.go 74.64% <100.00%> (+0.36%) ⬆️
selfservice/hook/show_verification_ui.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aeneasr aeneasr merged commit 054705b into master Apr 17, 2023
@aeneasr aeneasr deleted the jonas-jonas/hookOrdering branch April 17, 2023 14:46
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

2 participants