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

STCOR-820 For the /reset-password route, allow token to be specified in the path or query arguments #1445

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

ryandberger
Copy link
Member

  • Fulfills STCOR-820
  • Add support for optional URL parameter resetToken which allows us to use longer keys since path has a much smaller allowable length than URL params
  • Removed token param passed into <CreateResetPassword> component since it's not used there.

Copy link

github-actions bot commented Mar 19, 2024

Jest Unit Test Statistics

151 tests  +1   151 ✔️ +1   38s ⏱️ -1s
  30 suites +1       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 648cc78. ± Comparison against base commit 7b90d22.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 19, 2024

BigTest Unit Test Statistics

    1 files  ±0      1 suites  ±0   10s ⏱️ ±0s
266 tests ±0  260 ✔️ ±0  6 💤 ±0  0 ±0 
269 runs  ±0  263 ✔️ ±0  6 💤 ±0  0 ±0 

Results for commit 648cc78. ± Comparison against base commit 7b90d22.

♻️ This comment has been updated with latest results.

Copy link

sonarcloud bot commented Mar 19, 2024

@ryandberger ryandberger merged commit 71caf39 into keycloak Mar 22, 2024
6 checks passed
@ryandberger ryandberger deleted the STCOR-820 branch March 22, 2024 14:51
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

I have be honest, without any comments, I found this work hard to follow. IIUC, it used to be that CreateResetPasswordControl had a required token prop that's now optional, and if the prop is absent it'll look for a query-string param named resetToken. Is that correct, or at least partially so?

I realize the lack of documentation did not start with you, and I'm legit impressed with your ability to parachute in and figure out how to modify this component. For those of us who are less gifted, however, in-line comments are always appreciated :)

path="/reset-password/:token"
path="/reset-password/:token?"
Copy link
Member

Choose a reason for hiding this comment

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

Petty: technically the ? is not part of the path. It's not a problem that it's provided here, but at the same time it doesn't feel right. Also, why is being added here? That isn't clear, and since other path props don't include it, it should be explained in a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll update with a comment. It's a react-router convention that makes that part of the path optional. In this case it allows us to accept the path /reset-password?resetToken=ABC.

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, I misread it as /reset-password/token? without the leading colon 🤦 and so thought this was something else. Sorry for the distraction.

zburke pushed a commit that referenced this pull request Mar 28, 2024
…in the path or query arguments (#1445)

* STCOR-820 Add support for optionaly passing token by URL param

* Remove console.log

* Update CHANGELOG.md
zburke pushed a commit that referenced this pull request Mar 28, 2024
…in the path or query arguments (#1445)

* STCOR-820 Add support for optionaly passing token by URL param

* Remove console.log

* Update CHANGELOG.md
aidynoJ pushed a commit that referenced this pull request May 6, 2024
…in the path or query arguments (#1445)

* STCOR-820 Add support for optionaly passing token by URL param

* Remove console.log

* Update CHANGELOG.md
ryandberger added a commit that referenced this pull request May 15, 2024
…in the path or query arguments (#1445)

* STCOR-820 Add support for optionaly passing token by URL param

* Remove console.log

* Update CHANGELOG.md
zburke pushed a commit that referenced this pull request Jun 11, 2024
…in the path or query arguments (#1445)

* STCOR-820 Add support for optionaly passing token by URL param

* Remove console.log

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants