mapbox / mapbox-studio-classic

https://www.mapbox.com/mapbox-studio/
BSD 3-Clause "New" or "Revised" License
1.14k stars 229 forks source link

Packaged app won't authorize #1321

Closed TheMapSmith closed 9 years ago

TheMapSmith commented 9 years ago

Just updated my repo and things stopped working a la #1296

Completely deleted the repo and re-cloned and ran npm install with apparently no issues. npm install gist

npm start returns "Error: Cannot find module 'mapnik'" gist

So I downloaded the packaged app and got a "Connect to your account" screen

When I click Connect, I get a message: {"message":"Not Found"}

So I run the app on localhost:3000 and this is in the URL bar:

https://api.mapbox.com//oauth/authorize?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fmapbox&client_id=d8e0abd43fdbafe43c4fdc6059039595bd95518c4982050662d94c134c5538ea

2010 MBP OS X 10.9.5 Node 0.10.26

Thanks

willwhite commented 9 years ago

It looks like there is a double slash in that request URL. Try opening ~/.mapbox-studio/app.db and check for a trailing slash for the MapboxAPIAuth setting. It should be set to https://api.mapbox.com and not https://api.mapbox.com/.

TheMapSmith commented 9 years ago

Thanks @willwhite. I'm not sure how to open the app.db file, so I fixed the URL in the browser to do the authorization. Now I'm getting an "Authorization Failed" message when I do that, but when I look at my account on mapbox.com I see a new authorization for Mapbox Studio.

Edit: Realized I just had to open it in Atom. Removed the trailing '/' from the MapboxAPIAuth setting fixed both the packaged app and the web app.

I still can't start the app from the repo using npm start though. The same error as before persists. Any advice on that front?

Thanks again.

willwhite commented 9 years ago

Great, glad there was some improvement.

Which specific error are you hitting when you run with npm start? Is your repo up-to-date with mapbox-studio master?

TheMapSmith commented 9 years ago

It appears that trailing slash made all the difference. Doing a fresh clone and npm install resolved it.

Thanks!