kitajchuk / node-squarespace-server

DEPRECATED! A local Squarespace development server in node.js.
MIT License
186 stars 26 forks source link

Error fetching API data from Squarespace with middleware => Authorization Denied: You do not have enough permissions #183

Closed candinski closed 8 years ago

candinski commented 8 years ago

Hi,

I've been following this video (https://www.youtube.com/watch?v=tl6Dr4wh0ls) on how to set up a Squarespace site locally for development. I seem to be running into an error I can't resolve.

The Reader's Digest version of my steps are:

  1. Created a trial Squarespace account
  2. Added some pages and content
  3. Switched to developer mode (didn't register as a developer account)
  4. Cloned developer repo (the one ending in template.git)
  5. Edited the template.conf file (set sandbox to 'true')
  6. Ran sqs server

After running sqs server and viewing the site in the browser I just go the spinning loader while an error was shown in the terminal about Authorization Denied against the Squarespace API (see screenshot below).

When refreshing the browser view of localhost:5050 it then gave a different error about being unable to read 'layout' on undefined. I'm not sure if the refresh caused an object or variable to become unassigned given the API authorization error on first load.

This is what appeared in my terminal:

screen shot 2016 05 29 at 20 29 37

And this is what I've done to try troubleshoot the issue with no luck:

  1. Ran sqs buster and then sqs server --reload
  2. Tried the other template.conf options provided on your npm module page
  3. Tried registering a developer account on Squarespace
  4. Tried using different Squarespace templates

Am I missing something? Would appreciate your help!

kitajchuk commented 8 years ago

Looks like your login credentials aren't correct? Are you an admin?

j2is commented 8 years ago

I'm having the same issue on Mac trying to run Lange Squarespace theme locally. I installed using sudo npm install -g node-squarespace-server, so should have admin credentials. I downloaded Xcode and accepted the terms of license. Still no luck.

kitajchuk commented 8 years ago

@candinski @j2is The error you are seeing is a response from Squarespace. It's saying the login user you attempted to login with locally does not have sufficient privileges to access your sites data in the way the node server does. Your Squarespace account user has to be an admin, your template has to be in developer mode and you need to be a registered Squarespace Developer.

Does that make sense? The node server uses your user login to then access your site both as a proxy AND for api endpoints.

candinski commented 8 years ago

@kitajchuk Thanks for the feedback.

Unfortunately when accessing localhost:5050 it doesn't get to the login screen where it would ask for the username/password. It throws the permissions issue when first trying to access localhost.

As part of the test I have verified:

Is there a place it stores the login that I might need to delete? I just remembered that when I tried this the first time I got the login screen when I accessed localhost:5050, but then decided that I wanted to work on the theme on another account and have had issues ever since.

Happy to provide any required logs or if you have advice on lines to add to the node-squarespace-server module temporarily to dump some useful data.

Thanks again.

kitajchuk commented 8 years ago

@candinski Ok, cool. You can delete the login from Keychain Access. Open the app, select Passwords under Category in the sidebar and search "squarespace". The node server stores 2 values using SquarespaceEmail and SquarespacePassword as the Name entry. If you delete these, you will be prompted to login again when you boot the server.

candinski commented 8 years ago

@kitajchuk - That did it. I can now get to the login screen. Thank you for all the help!

@j2is - This may solve your issue too so worth a try.

kitajchuk commented 8 years ago

@candinski Sweet! Sorry for the back and forth. Let me know if you have any other issues.