When you start the provided glitch, it begins with errors and compiles to “Show off” instead of the usual “Show live”… have I missed adding something in?
Well, first thing, I don’t see where you’re loading in the .env file. I haven’t worked with glitch much, but usually .env need to be loaded - they’re not automatic. Usually you need to install a package like dotenv and then put something like require('dotenv').config() at the top of your server. Or you could write your own loader.
To confirm, I would put a console.log somewhere to check if those variables are getting loaded.
That would make sense but I went and checked other FCC glitch templates and none of the ones I’ve used seem to have code like that either.”
require(‘dotenv’).config() throws the error “Error: Cannot find module 'dotenv’github”
Also, file now has “Show live” as it’s status, but still runs into the same errors when I test on FCC. I’ll keep looking into it, see if there’s something else I can do to make it work.
You need to add the following to your .env file and fill in the data like in the previous Advanced Node and Express challenges. For the SESSION_SECRET I just made up a number but it works (sorry for the hacky explanation):
Sorry, I guess I skimmed your post. Here’s my totally unsatisfying answer for you: NONE of the tests have passed for me for any of the Advanced Node and Express Challenges, and I’m on the third-to-last-one right now.
So I must have faulty code? No, I don’t. Other people have had similar problems, and yet for still others the tests do pass. So I don’t know.
Looking at your project, though, there is one more thing I can suggest you try. In your auth.js file, you have the following as the callback still in the strategy object: “callbackURL: “https://buttercup-delete.gomix.me/auth/github/callback””
That needs to be changed to your project callback url. Maybe that helps. If not, I think I’m out of ideas.
No worries, I appreciate the attempt! I’m stumped.
Yeah, I had a bunch of challenges with the earlier ones too. Eventually got them all to pass up until this one, but all of the tweaks I’ve been recommended here or that I found online haven’t fixed it
I’ve re-typed two other glitches with the template, using the same code and couldn’t get them to work, so I assumed the error was in my code…
Also, I tried what you recommended regarding the callback URL, but I’m still getting the same response when I run the tests:
// running test
error
error
error
error
// tests completed
I’ve had the same issue with the app.use(cors()); as well.
Now I pass all the tests. However, when I try to login it comes up with “page not found”; none of my log statements actually log apart from the one inside route(’/’)
all the following don’t work
The solution given above works so well that even if you don’t do anything it passes. The real thing here is if anyone got the message that a user has connected?