I cannot pass A Get request to /profile correctly redirects to / since we are not authenticated also I copied the later solution and also not work.
the code is here
Comparing your code to my code for the same back end section, I think the problem lies here:
app.route('/profile')
.get(ensureAuthenticated, (req, res) => {
res.render(process.cwd() + '/views/pug/profile', /*-->*/{username: req.user.username}/*<--*/);
});
Try console logging req.user.username and see what it logs and adjust based off that.
EDIT: this is a bad comparison, I donāt think the above is the case, i need to remix your project to investigate further
So compared more code, but not sure what the problem is.
Here is my code from same series of challenges from glitch if youād like to compare, but not sure what is causing the issue. https://glitch.com/edit/#!/advnodenexpressregs?path=routes.js:98:20
your code had gave same output.
and in
Iām having a similar issue with this problem. It successfully redirects, but the test still fails. Just replying to so I can bookmark this post in case someone figures it out.
See the issue on Github. It looks like the way the test is implemented, after the page is redirected it is looking for the words āHome pageā to be present in the HTML.
The directions for the problem do not clearly state that the pug template should be updated, or that the title should be changed from āhelloā, to āHome pageā.
The easiest way to fix this is to change the title value to Home Page in the render function for the index page. Otherwise it looks like your code should be fine to pass the test.
I have started new glitch and passed.
Did you do anything differently with your new Glitch?
Iām just curious because Iām running into issues with other challenges not passing when the functionality of the app is working.
No, I was surprised it work.
This worked for me thanks
starting a new glitch session did not work for me, but changing the the title value did solve the problem. Thanks @hagnerd!
Thanks, in the ā/ā route, changing { title: āHome Pageā } worked for me, too.
Thanks, this worked for me.
app.route('/')
.get((req, res) => {
res.render(process.cwd() + '/views/pug/index', {showLogin: true, title: 'Home Page ', message: 'Please login'});
});
Worked for me too,
Thanks a lot
change the title of index to homepage ,It works for me
This did it for me. This is a problem with the challengeās directions.
This worked for me. Where in the steps, it said to change the title to Home page
This worked for me as well. Thanks
I was crazy struggled and finally I just changed the h1 text in index.pug and profile.pug
Is it normal ? I spendt a half day just for that