I am having a tough time determine what “server” I need to be using for this challenge. I tried both my application homepage on github and my callback URL, but still can’t pass the test. Could someone help me understand what server URL I should be using?
So if you’re talking about this line: io.connect('https://glitch.com/@jpvajda/auth/github/callback');
I don’t think you need that URL because you are connecting to a socket hosted at the same URL as your app. You only need to pass a URL if it’s an external socket. So try it with no URL.
If it’s still not working…if I remember correctly from when I did this challenge…There were a number of things I had to do to get it set up correctly that weren’t specified in the instructions. Like connect to the database again, and get new CLIENT_ID and CLIENT_SECRET from Github. Unfortunately I can’t remember all of the details, but it was all the kind of stuff that the previous challenges went through. So check for errors in the console. And just see if you are missing anything.
Thanks for the suggestions… I did remove the io.connect URL reference, and it still not working. I also tried creating a new CLIENT_SECRET and that also didn’t pass the test… so I’ll keep trying to figure this one out
Also I needed to change the callbackURL for the GitHubStrategy in the auth.js file as well. They give a URL to some project, but it should be your app’s URL with “/auth/github/callback”.
@stressstressstress I fixed that callback URL on the auth.js file, and when I click on the login with github link I get this console error:
Content Security Policy: The page’s settings blocked the loading of a resource at https://github.com/login/oauth/authorize?response_type=code&…da%2Fauth%2Fgithub%2Fcallback&client_id=08c1bd8f5f82b9f8f967 (“frame-src”)
Is this a cors issue? I’ve added cors to my dependencies in the package.json file and added this to the server.js file. Am I missing something here to get the URL to be accessible from the project page?
@stressstressstress That worked as I set that in the github application as the callback URL and also in the auth.js file, , it routes correctly to github for authorization, but the test still doesn’t pass…
@stressstressstress I figured it out! I didn’t realize there was a client.js file in /public and made my own in the root of the project, so once I discovered that, I added
/*global io*/
var socket = io();
to that file and it passed! Thanks for all your help here, I definitely appreciate it.