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

Wix user information [PERMISSION_DENIED] Error in nextjs #528

Open
hu1won opened this issue Apr 11, 2024 · 1 comment
Open

Wix user information [PERMISSION_DENIED] Error in nextjs #528

hu1won opened this issue Apr 11, 2024 · 1 comment

Comments

@hu1won
Copy link

hu1won commented Apr 11, 2024

Hello,

I would like to obtain user information from Wix in order to use Wix's payment system on the web I operate.
I created a Wix client and entered all key values ​​correctly.
However, an error occurs as shown in the picture below. Please tell me the solution.

errorcode

If this can be resolved, I will load the user information into Wix , log in the user, and proceed with the payment.

Please let me know if this is a realistic logic after resolving the error. You will use a different domain than the domain of the web page created by Wix. I want to load information about Wix from that domain and enable the loaded users to make payments.

  • Why did this problem occur, and is there a way to solve this problem?
  • I attach the code below.
  • My webpage is composed of nextjs.
useEffect(() => {
    async function fetchSession() {
      const session = await getSession();
      if (session) {
        setUserEmail(session.user.email);
      
        const client = createClient({
          modules: {
            authentication,
            members,
          },
          auth: ApiKeyStrategy({
            apiKey: process.env.API_KEY,
            accountId: process.env.ACCOUNT_ID,
            siteId: process.env.SITE_ID,
          }),
        });

        console.log(session.user.email);

        const user  = await client.members
        .queryMembers()
        .eq('loginEmail', session.user.email)
        .find().catch((error) => {
          console.error("=====>>" + error + "<<====");
        }
        );
      }
    }

    fetchSession();
  }, []);
@Idokah
Copy link
Collaborator

Idokah commented Apr 11, 2024

make sure you set the permission config for this table - take a look here, under permissions, how you can do it.

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

No branches or pull requests

2 participants