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: add new message when refresh parameter is true #1560

Merged
merged 6 commits into from
Jul 30, 2021

Conversation

nanikjava
Copy link
Contributor

PR for fixing #1117

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! This looks really good already! There are a few more things we need to do to get it merged.


The CI is failing because some files are formatted incorrectly. To format them, run:

$ make format
$ git commit -a -m "styles: format code"
$ git push

Please also add a test around here

assert.Empty(t, gjson.GetBytes(body, "ui.nodes.#(attributes.name==password).attributes.value").String(), "%s", body)

verifying that the message is set in the payload :)

Thank you!

// 500: jsonError
// 401: jsonError
Copy link
Member

Choose a reason for hiding this comment

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

Revert order

@@ -8,7 +8,8 @@ import (
const (
InfoSelfServiceVerification ID = 1070000 + iota // 1070000
InfoSelfServiceVerificationEmailSent // 1070001
InfoSelfServiceVerificationSuccessful // 1060002
InfoSelfServiceVerificationSuccessful // 1070002
Copy link
Member

Choose a reason for hiding this comment

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

Since this is in the login UI, please put it in message_login and give it a descriptive name

@nanikjava
Copy link
Contributor Author

nanikjava commented Jul 17, 2021

Thank you! This looks really good already! There are a few more things we need to do to get it merged.

The CI is failing because some files are formatted incorrectly. To format them, run:

$ make format
$ git commit -a -m "styles: format code"
$ git push

Please also add a test around here

assert.Empty(t, gjson.GetBytes(body, "ui.nodes.#(attributes.name==password).attributes.value").String(), "%s", body)

verifying that the message is set in the payload :)

Thank you!

@aeneasr

Thanks for the comment. Will fix it up and add the test.

Frankly, I'm still confused of the use case of this fix, as just started to get myself down and dirty with the code :)

The fix will include message Please confirm this action by verifying that it's you. when the ?refresh=true flag is set. Does this mean that regardless of what the state of the login is as long as the URL include the ?refresh=true flag that message will be passed back ?

I've updated the PR. Thanks

@nanikjava nanikjava changed the title [WIP] fix: add new message when refresh parameter is true fix: add new message when refresh parameter is true Jul 17, 2021
@nanikjava nanikjava requested a review from aeneasr July 17, 2021 03:58
@codecov
Copy link

codecov bot commented Jul 17, 2021

Codecov Report

Merging #1560 (e9eb4d1) into master (60d848d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1560      +/-   ##
==========================================
+ Coverage   74.17%   74.19%   +0.01%     
==========================================
  Files         257      257              
  Lines       12557    12565       +8     
==========================================
+ Hits         9314     9322       +8     
  Misses       2624     2624              
  Partials      619      619              
Impacted Files Coverage Δ
selfservice/flow/login/handler.go 67.96% <100.00%> (+0.50%) ⬆️
text/message_login.go 71.69% <100.00%> (+3.61%) ⬆️
x/nosurf.go 92.59% <100.00%> (ø)

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 64c90bf...e9eb4d1. Read the comment docs.

@nanikjava
Copy link
Contributor Author

@aeneasr any feedback on the PR ? Thanks.

@aeneasr
Copy link
Member

aeneasr commented Jul 23, 2021

@nanikjava sorry for the long response time, I didn't have time to review things because it was a really busy week.

The fix will include message Please confirm this action by verifying that it's you. when the ?refresh=true flag is set. Does this mean that regardless of what the state of the login is as long as the URL include the ?refresh=true flag that message will be passed back ?

Yes, exactly, that would be the case. I think it's an o.k. workaround for now.

There is still an open item, could you please address my comment:

#1560 (comment)

Thank you for your hard work! :)

@nanikjava
Copy link
Contributor Author

@nanikjava sorry for the long response time, I didn't have time to review things because it was a really busy week.

The fix will include message Please confirm this action by verifying that it's you. when the ?refresh=true flag is set. Does this mean that regardless of what the state of the login is as long as the URL include the ?refresh=true flag that message will be passed back ?

Yes, exactly, that would be the case. I think it's an o.k. workaround for now.

Ok cool. Thanks for confirming about the behaviour.

There is still an open item, could you please address my comment:

#1560 (comment)

Thank you for your hard work! :)

Fixed.

@nanikjava
Copy link
Contributor Author

@aeneasr Checked the E2E test and looks like it has 1 test case failing using cockroachdb not sure what is the problem.

Tried running locally by executing the run.sh inside test/e2e/run.sh but not able to run completely as it keeps on timing out after the following

waiting for 6 resources: http-get://127.0.0.1:4434/health/ready, http-get://127.0.0.1:4455/health, http-get://127.0.0.1:4446/, http-get://127.0.0.1:4456/health, http-get://127.0.0.1:4457/, http-get://127.0.0.1:4437/mail
waiting for 5 resources: http-get://127.0.0.1:4434/health/ready, http-get://127.0.0.1:4455/health, http-get://127.0.0.1:4456/health, http-get://127.0.0.1:4457/, http-get://127.0.0.1:4437/mail
waiting for 4 resources: http-get://127.0.0.1:4434/health/ready, http-get://127.0.0.1:4455/health, http-get://127.0.0.1:4456/health, http-get://127.0.0.1:4457/
waiting for 3 resources: http-get://127.0.0.1:4434/health/ready, http-get://127.0.0.1:4455/health, http-get://127.0.0.1:4457/
waiting for 2 resources: http-get://127.0.0.1:4434/health/ready, http-get://127.0.0.1:4457/
waiting for 1 resources: http-get://127.0.0.1:4457/

@@ -48,6 +47,15 @@ func NewVerificationEmailSent() *Message {
}
}

func NewVerificationConfirmation() *Message {
Copy link
Member

Choose a reason for hiding this comment

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

Please move this to message_login - this file should stay unmodified. message_verification refers to the self-service verification (e.g. email verification flow). Thank you :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aeneasr Thanks for the feedback. Changes has been moved to message_login. Hope I did it right this time :)

@aeneasr
Copy link
Member

aeneasr commented Jul 30, 2021

Thank you! I added some changes but overall this looks very good! Ready to be merged :)

@aeneasr aeneasr merged commit 0525623 into ory:master Jul 30, 2021
harnash pushed a commit to Wikia/kratos that referenced this pull request Aug 3, 2021
Closes ory#1117

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

2 participants