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(selfservice): Login self service flow with TOTP does not pass on return_to URL #2175

Merged
merged 4 commits into from
Feb 1, 2022

Conversation

sawadashota
Copy link
Contributor

Related issue(s)

#2172

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
    [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

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #2175 (b3aee33) into master (d9c8217) will increase coverage by 0.03%.
The diff coverage is 75.00%.

❗ Current head b3aee33 differs from pull request most recent head d65da17. Consider uploading reports for the commit d65da17 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2175      +/-   ##
==========================================
+ Coverage   75.27%   75.30%   +0.03%     
==========================================
  Files         294      294              
  Lines       15629    15648      +19     
==========================================
+ Hits        11764    11784      +20     
+ Misses       3033     3031       -2     
- Partials      832      833       +1     
Impacted Files Coverage Δ
session/manager.go 88.57% <73.33%> (-11.43%) ⬇️
selfservice/flow/login/hook.go 89.01% <77.77%> (-1.80%) ⬇️
persistence/sql/persister_courier.go 88.33% <0.00%> (+3.33%) ⬆️
internal/testhelpers/selfservice_login.go 100.00% <0.00%> (+5.26%) ⬆️

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 d9c8217...d65da17. Read the comment docs.

}

if err := aalErr.PassReturnToParameter(a.RequestURL); err != nil {
return aalErr, true
Copy link
Contributor

Choose a reason for hiding this comment

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

Wasn't this supposed to be:

Suggested change
return aalErr, true
return err, true

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I fixed.

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.

This looks good to go! Just one little test :)

@@ -41,6 +42,28 @@ func (e *ErrAALNotSatisfied) EnhanceJSONError() interface{} {
return e
}

func (e *ErrAALNotSatisfied) PassReturnToParameter(requestURL string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a dedicated, small test for this? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK! I've added.

@aeneasr aeneasr self-assigned this Jan 31, 2022
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.

Thank you for your great contributions, as always! /cc @vinckr not sure if we've sent out some swag to @sawadashota already? :)

@aeneasr aeneasr merged commit 3eaa88e into ory:master Feb 1, 2022
@sawadashota sawadashota deleted the fix-2172 branch February 1, 2022 13:23
@vinckr
Copy link
Member

vinckr commented Feb 1, 2022

Hello @sawadashota

As Aeneas mentioned we should have sent you some swag ages ago!
You are one of the earliest and steadiest contributors to Ory, many many thanks for your work 🙇
Your contributions are helping secure millions of identities around the globe 🌏.

As a small token of appreciation we would love to send you a gift package.
Please drop me an email and I will forward you the form to claim your Ory swag!

@vinckr vinckr mentioned this pull request Mar 18, 2022
peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this pull request Jun 30, 2023
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.

4 participants