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 issue with verify email redirect using Auth0 #1990

Merged
merged 3 commits into from
Mar 17, 2021

Conversation

o0charlie0o
Copy link
Contributor

When clicking the verify email link in an Auth0 email upon success Auth0 redirects to the main url defined with a bunch of search params. One of those params happens to be code= which restoreAuthState looks for in the AuthProvider. It does not however include the state param causing the rest of this function to fail with an invalid state error. This PR makes sure both code and state exist before continuing with the redirect callback.

Example of the url Auth0 redirects to:
https://www.sample-website.com/?supportSignUp=true&supportForgotPassword=true&email=email%40sample-website.com&message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application.&success=true&code=success#

@github-actions
Copy link

github-actions bot commented Mar 12, 2021

📦 PR Packages

Click to Show Package Download Links

https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/create-redwood-app-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-api-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-api-server-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-auth-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-cli-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-core-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-dev-server-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-eslint-config-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-eslint-plugin-redwood-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-forms-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-internal-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-prerender-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-router-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-structure-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-testing-0.27.1-e9d8be5.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1990/redwoodjs-web-0.27.1-e9d8be5.tgz

Install this PR by running yarn rw upgrade --pr 1990:0.27.1-e9d8be5

@o0charlie0o o0charlie0o marked this pull request as draft March 12, 2021 18:23
@peterp
Copy link
Contributor

peterp commented Mar 16, 2021

@o0charlie0o anything I can do to help this along?

@o0charlie0o
Copy link
Contributor Author

@peterp I think it mainly needs to be tested although I have done that locally without issue. I put it in draft due to that failing test but I'm not really sure why it failed at the moment.

@peterp
Copy link
Contributor

peterp commented Mar 16, 2021

Let me re-run the tests, since those failures look completely unrelated.

@peterp peterp marked this pull request as ready for review March 17, 2021 05:47
@peterp peterp added this to the next release milestone Mar 17, 2021
@peterp peterp merged commit fd42de9 into redwoodjs:main Mar 17, 2021
dac09 added a commit to dac09/redwood that referenced this pull request Mar 22, 2021
…r-rwt-link

* 'main' of github.com:redwoodjs/redwood: (26 commits)
  Router: Fix auth (redwoodjs#2038)
  Steps towards a11y for Redwood Router (redwoodjs#1817)
  Router: <Set wrap={}> (redwoodjs#1898)
  Pass event and context into getCurrentUser (redwoodjs#1908)
  Implement Redwood API side Logger (redwoodjs#1937)
  Fixed path on windows to allow for pages under subdirectories (redwoodjs#2022)
  Add experimental ESBuild for api side (redwoodjs#1948)
  Upgrade to Prisma 2.19.0 (Prisma Migrate GA) (redwoodjs#2021)
  Fix lint breaking when deleting a side (redwoodjs#2017)
  Refactor: Converted Prisma.ts to js (redwoodjs#1958)
  Fix issue with verify email redirect using Auth0 (redwoodjs#1990)
  add GitHub Action CodeQL Analysis (redwoodjs#1951)
  fix: correct var name for grabbing user config (redwoodjs#2002)
  Create functions to fs calls (redwoodjs#2007)
  Return signup Output (redwoodjs#1992)
  Add makeExecSchema options (redwoodjs#1964)
  upgrade gotrue-js to 0.9.29 (redwoodjs#2011)
  Azure Active Directory Auth: Adding try-catch block on callback to capture empty key (redwoodjs#2010)
  withCellHOC: Fix TS error (redwoodjs#1967)
  Update error message in tasks/publish-local to point to tasks/run-local-npm when Verdaccio isn't running (redwoodjs#2004)
  ...
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.

3 participants