Hi there.
I am working my way through Advanced Node and Express (https://www.freecodecamp.org/learn/quality-assurance/#advanced-node-and-express) and have passed all the tests (done 20 lessons so far). However, although I am passing the tests I am not really seeing what the lessons say I should see.
For example, in lesson 18 (Communicate by Emitting) it says "Now, try loading up your app, authenticate, and you should see in your client console '1' representing the current user count! Try loading more clients up, and authenticating to see the number go up."
I don’t see that in my console.
Lesson 20 (Authentication with Socket.IO) has me putting this code into my server.js
function onAuthorizeSuccess(data, accept) {
console.log('successful connection to socket.io');
accept(null, true);
}
function onAuthorizeFail(data, message, error, accept) {
if (error) throw new Error(message);
console.log('failed connection to socket.io:', message);
accept(null, false);
}
When I run via https://boilerplate-advancednode.alanbra.repl.co and press Login
I get a screen like so:
My console just shows:
If I run via https://boilerplate-advancednode.alanbra.repl.co and press Login via Github!
I get a screen like so:
and my console looks like this:
npm start
> fcc-advanced-node-and-express@0.0.1 start
> node server.js
Listening on port 3000
{
id: '112013861',
displayName: null,
username: 'AlanBrad',
profileUrl: 'https://github.com/AlanBrad',
photos: [
{ value: 'https://avatars.githubusercontent.com/u/112013861?v=4' }
],
provider: 'github',
_raw: '{"login":"AlanBrad","id":112013861,"node_id":"U_kgDOBq0yJQ","avatar_url":"https://avatars.githubusercontent.com/u/112013861?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanBrad","html_url":"https://github.com/AlanBrad","followers_url":"https://api.github.com/users/AlanBrad/followers","following_url":"https://api.github.com/users/AlanBrad/following{/other_user}","gists_url":"https://api.github.com/users/AlanBrad/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanBrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanBrad/subscriptions","organizations_url":"https://api.github.com/users/AlanBrad/orgs","repos_url":"https://api.github.com/users/AlanBrad/repos","events_url":"https://api.github.com/users/AlanBrad/events{/privacy}","received_events_url":"https://api.github.com/users/AlanBrad/received_events","type":"User","site_admin":false,"name":null,"company":null,"blog":"","location":null,"email":null,"hireable":null,"bio":null,"twitter_username":null,"public_repos":7,"public_gists":0,"followers":0,"following":0,"created_at":"2022-08-24T18:10:24Z","updated_at":"2022-10-14T22:26:40Z"}',
_json: {
login: 'AlanBrad',
id: 112013861,
node_id: 'U_kgDOBq0yJQ',
avatar_url: 'https://avatars.githubusercontent.com/u/112013861?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/AlanBrad',
html_url: 'https://github.com/AlanBrad',
followers_url: 'https://api.github.com/users/AlanBrad/followers',
following_url: 'https://api.github.com/users/AlanBrad/following{/other_user}',
gists_url: 'https://api.github.com/users/AlanBrad/gists{/gist_id}',
starred_url: 'https://api.github.com/users/AlanBrad/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/AlanBrad/subscriptions',
organizations_url: 'https://api.github.com/users/AlanBrad/orgs',
repos_url: 'https://api.github.com/users/AlanBrad/repos',
events_url: 'https://api.github.com/users/AlanBrad/events{/privacy}',
received_events_url: 'https://api.github.com/users/AlanBrad/received_events',
type: 'User',
site_admin: false,
name: null,
company: null,
blog: '',
location: null,
email: null,
hireable: null,
bio: null,
twitter_username: null,
public_repos: 7,
public_gists: 0,
followers: 0,
following: 0,
created_at: '2022-08-24T18:10:24Z',
updated_at: '2022-10-14T22:26:40Z'
}
}
No mention made of any connection to socket.io
(successful or otherwise).
I’m very confused and am sure I must be doing something wrong somewhere even though I’m passing the tests.
My replit code is at boilerplate-advancednode - Replit