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(dbAuth): Don't throw errors under normal auth flow conditions #10927

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jul 9, 2024

The main issue I'm fixing here is that an error would be thrown if the user had some/any cookie set, but not valid session cookies.

Cookies expiring, cookies not being available, cookies having weird values are all common scenarios for any auth flow. They're not exceptional, so no exceptions should be raised (i.e. the code shouldn't throw an error).

The error messages we would throw are still helpful in some cases though during development. So I kept them around, but only print them as debug messages, and only when NODE_ENV is 'development'

@Tobbe Tobbe added the release:fix This PR is a fix label Jul 9, 2024
@Tobbe Tobbe added this to the SSR milestone Jul 9, 2024
Copy link
Collaborator

@dac09 dac09 left a comment

Choose a reason for hiding this comment

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

LGTM!

@dac09 dac09 merged commit 10165ec into redwoodjs:main Jul 9, 2024
51 checks passed
dac09 pushed a commit to dac09/redwood that referenced this pull request Jul 12, 2024
…iddleware

* 'main' of github.com:redwoodjs/redwood:
  fix(docs): Fix introduction link (redwoodjs#10938)
  fix(cli-helpers): Fix CJS support (redwoodjs#10936)
  chore(cli-helpers): Formatting
  chore(cli-helpers): loadEnvFiles cleanup (redwoodjs#10935)
  feat(cli-helpers): Add loadEnvFiles (redwoodjs#10931)
  chore(cli-helpers): Fix dual package build. Align with new pattern (redwoodjs#10933)
  fix(dbAuth): Don't throw errors under normal auth flow conditions (redwoodjs#10927)
  chore(dbAuth): Fix typo in comment, and refactor dbAuthSession (redwoodjs#10928)
@Josh-Walker-GM Josh-Walker-GM modified the milestones: SSR, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants