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: recovery with OAuth2 and 2FA #3834

Closed
wants to merge 1 commit into from
Closed

Conversation

hperl
Copy link
Contributor

@hperl hperl commented Mar 20, 2024

Related issue(s)

https://github.com/ory-corp/cloud/issues/6066

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
    [email protected]) 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

@hperl hperl requested review from aeneasr and zepatrik as code owners March 20, 2024 12:04
@hperl hperl requested a review from jonas-jonas March 20, 2024 12:04
@hperl hperl self-assigned this Mar 20, 2024
@@ -341,7 +341,7 @@ func (s *ManagerHTTP) DoesSessionSatisfy(r *http.Request, sess *Session, request
return nil
}

loginURL := urlx.CopyWithQuery(urlx.AppendPaths(s.r.Config().SelfPublicURL(ctx), "/self-service/login/browser"), url.Values{"aal": {"aal2"}})
loginURL := &url.URL{Path: "/self-service/login/browser", RawQuery: "aal=aal2"}
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the difference to be honest?

Copy link
Member

Choose a reason for hiding this comment

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

If the idea is to not use the domain, then this won't work because the public url might have a path prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The bug I want to fix is that if Kratos runs on multiple domains / CNAMEs, redirecting to the public URL will cause the user to end up on a different domain than he started on.

If we redirect without a host, the current host will continue to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the idea is to not use the domain, then this won't work because the public url might have a path prefix

OK, so then we can just extract the path prefix from the public URL?

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.01%. Comparing base (9ddf7cc) to head (b791390).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3834      +/-   ##
==========================================
+ Coverage   77.95%   78.01%   +0.06%     
==========================================
  Files         358      358              
  Lines       25165    25165              
==========================================
+ Hits        19617    19633      +16     
+ Misses       4041     4026      -15     
+ Partials     1507     1506       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hperl
Copy link
Contributor Author

hperl commented Mar 21, 2024

This is not the fix I was looking for.

@hperl hperl closed this Mar 21, 2024
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.

2 participants