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

Envelop: Don't use useImmediateIntrospection as it causes auth bug #4538

Merged

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Feb 20, 2022

Envelop recently added a new plugin:

Add new plugin useImmediateIntrospection for speeding up introspection only operations by skipping context building.

We added that in faede7f, but it seems it caused some auth bugs. See #4520

So this PR reverts that change.

It was only enabled in dev as a performance optimization. So should be safe to go without.

Fixes: #4520

@dthyresson
Copy link
Contributor

I have tested this same change on my Netlify Blog with RBAC w/ v0.46 and getCurrentUser is being properly set in context again.

Thank you @Tobbe!

Copy link
Contributor

@dthyresson dthyresson 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 upgraded https://github.com/dthyresson/redwoodblog-rbac to v0.46 and then locally changed:


  if (!isDevEnv) {
    plugins.push(useDisableIntrospection())
  }
  // else {
  //   plugins.push(useImmediateIntrospection())
  // }

And did rwfw and refreshes and getCurrentUser is setting context again.

@Tobbe Tobbe merged commit bd8fcfa into redwoodjs:main Feb 20, 2022
@Tobbe Tobbe deleted the tobbe-envelop-no-use-immediate-introspection branch February 20, 2022 13:51
@jtoar jtoar added this to the next-release milestone Feb 20, 2022
dac09 added a commit to dac09/redwood that referenced this pull request Feb 21, 2022
…test

* 'main' of github.com:redwoodjs/redwood: (23 commits)
  Netlify client getToken fix when GoTrue client refreshes JWT (redwoodjs#4539)
  Update dependency @supabase/supabase-js to v1.30.4 (redwoodjs#4536)
  Envelop: Don't use useImmediateIntrospection as it causes auth bug (redwoodjs#4538)
  Update dependency react-hook-form to v7.27.1 (redwoodjs#4521)
  try increasing timeout for flaky test (redwoodjs#4526)
  Update dependency stacktracey to v2.1.8 (redwoodjs#4519)
  Update dependency msw to v0.38.1 (redwoodjs#4525)
  Update dependency eslint-config-prettier to v8.4.0 (redwoodjs#4522)
  Provide a Revised Runtime Error Page (redwoodjs#4167)
  update yarn.lock
  v0.46.0
  Update dependency esbuild to v0.14.23 (redwoodjs#4518)
  Fix Storybook build args (redwoodjs#4455)
  Update dependency react-helmet-async to v1.2.3 (redwoodjs#4502)
  Bump url-parse in /__fixtures__/example-todo-main-with-errors (redwoodjs#4511)
  Bump url-parse from 1.5.1 to 1.5.7 in /__fixtures__/example-todo-main (redwoodjs#4512)
  Update dependency fastify to v3.27.2 (redwoodjs#4516)
  Uncomment role checks (redwoodjs#4476)
  Update dependency zx to v5.1.0 (redwoodjs#4505)
  Update dependency firebase to v9.6.7 (redwoodjs#4514)
  ...
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
No open projects
Status: Archived
Development

Successfully merging this pull request may close these issues.

Netlify Identity Auth, currentUser context goes undefined on refresh of page.
4 participants