ryanlelek/Raneto

Error redirect not logged in anymore

leofranke95 opened this issue · 2 comments

Hey I have found a error if you are logged in to the page and the webserver restarts and you want to refresh the edit page, the redirect is not relative to base url.

It is found in the wildcard.route.js line 66

// Edit Page if ((config.authentication || config.authentication_for_edit) && !req.session.loggedIn) { res.redirect('/login'); return; }

It should be like this yes?

res.redirect(config.base_url + '/login');

This is important only where the app has a not default base_url. For example the app can be found for /mywiki.
In this case instead of /mywiki/login it will only redirect to /login where no route can be found.
Sorry if this is not an error and should be like this.

Yep, sounds reasonable!
Let me do some further testing.

Ok, added this functionality.
Since it was 1-line and what you suggested, I merged it to master
#351

Thank you!
Let us know if this solves the issues you had