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

[Bug?]: Upgrading to 7.1.3 - "You don't have permission to do that." #10223

Open
1 task
johndevor opened this issue Mar 14, 2024 · 8 comments
Open
1 task

[Bug?]: Upgrading to 7.1.3 - "You don't have permission to do that." #10223

johndevor opened this issue Mar 14, 2024 · 8 comments
Assignees
Labels
bug/needs-info More information is needed for reproduction topic/auth topic/graphql

Comments

@johndevor
Copy link

What's not working?

Graphql is returning Error: You don't have permission to do that.

Me and at least one other person are seeing the issue. Works fine locally, but not in serverless (netlify) for me.

Apparently the context is not getting populated properly?

https://community.redwoodjs.com/t/redwood-v7-0-0-upgrade-guide/5713/52?u=john

How do we reproduce the bug?

No response

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@johndevor johndevor added the bug/needs-info More information is needed for reproduction label Mar 14, 2024
@johndevor
Copy link
Author

Other person with the same issue:

https://community.redwoodjs.com/t/redwood-v7-0-0-upgrade-guide/5713/54

@Josh-Walker-GM
Copy link
Collaborator

Thanks for opening the issue @johndevor. I'll try to at least get started on reproducing this over the weekend as I imagine this is a blocker for you upgrading.

@chrismorrisprojects
Copy link

chrismorrisprojects commented Mar 19, 2024

I am the other person in the thread having the issue, it is still happening on 7.1. I have created a work around that allows me to access the context but I don't know why accessing it directly returns undefined:

export const isAuthenticated = () => {
  const currentUserDescriptor = Object.getOwnPropertyDescriptor(context, 'currentUser');
  const currentUser = currentUserDescriptor ? currentUserDescriptor.value : null;
  return !!currentUser
}

@Josh-Walker-GM
Copy link
Collaborator

Josh-Walker-GM commented Mar 19, 2024

Thank you so much for the additional information! I haven't had a chance to properly look into this yet as I've been traveling. I will aim to get something substantially done on this by the end of the week.

@johndevor
Copy link
Author

I tried that on netlify without success:

export const isAuthenticated = () => {
  const currentUserDescriptor = Object.getOwnPropertyDescriptor(
    context,
    'currentUser'
  )
  console.log('currentUserDescriptor', currentUserDescriptor)
  const currentUser = currentUserDescriptor ? currentUserDescriptor.value : null
  return !!currentUser
}

Mar 20, 10:49:43 AM: f451b5e9 INFO currentUserDescriptor undefined

@Josh-Walker-GM Josh-Walker-GM self-assigned this Apr 3, 2024
@Josh-Walker-GM
Copy link
Collaborator

It took me far to long to get back to this so sorry about that!

I just tried deploying our dbAuth based test project to netlify and it seems to work just fine with auth and graphql. That was on redwood 7.3.0.

I'll try switching the auth to clerk tomorrow to see if that's a factor but context usually lives at a level below each provider so I would have naturally expected if it was broken for all auth providers to fail. I could easily be wrong though. I'll follow up with what happens when I switch it to clerk.

@Josh-Walker-GM
Copy link
Collaborator

Hi everyone. There have been multiple reports over a period of time that there is an unresolved issue with context. However, I'm having difficulty reproducing this error and so can't move forward with debugging and fixing.

What would help move this along is if someone can please provide a complete but small reproduction repository that I could clone down and reproduce the error. It appears this might only happen on deployed applications - especially serverless deployments. Given that information, it would also be helpful if this reproduction repo could be deployed to netlify/vercel.

I will keep trying to return to this when I can but until a reproduction is available I cannot move this forward. Hopefully this is a reasonable next step here? I appreciate that it could be blocking upgrading to v7 so apologies again that this issue has been so long running.

@chrismorrisprojects
Copy link

My build is a bare metal instance running in Azure cloud.

I have other bare metal instances of Redwoodjs, the only difference between them is the use of azure-active-directory authentication in the one that is not working.

I am not sure how I could set up a reproduce-able instance that involves azure-active-directory unless there is some free testing service Microsoft or someone provides?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/auth topic/graphql
Projects
None yet
Development

No branches or pull requests

4 participants