Redirect from login view
When a user is not "logged in" and tries to access a page, they are redirected to the login page (as is desired). However after logging in they are sent to the home page. Instead, they should be sent to the page they were originally trying to access.
Hello again! I'm new to all this and I'm trying to find a good first issue. I've completed an online course that gave me familiarity with java, html, and css and the MEN stack and I'm working through the MIT online courseware for python right now. would this be a good first issue? Thanks so much for your response!
This would be a great issue to start with!
To get you started, the 'login' page is rendered here: https://github.com/inventree/InvenTree/blob/master/InvenTree/templates/registration/login.html
And the code which is responsible for redirecting an unauthenticated user to the login page is under AuthRequiredMiddleware - https://github.com/inventree/InvenTree/blob/master/InvenTree/InvenTree/middleware.py
great! I am gonna start working on this. Can you assign me? Also, to be clear, as far as I can tell you can't access any page without being logged first. Is the user in question trying to access a part by it's URL and then being redirected to the login page?
Also, to be clear, as far as I can tell you can't access any page without being logged first. Is the user in question trying to access a part by it's URL and then being redirected to the login page?
Yep, exactly. Sometimes if the browser logs you out, but the page is still "loaded" in the browser, you'll click on a link and instead be redirected to the login page and then have to find your way back.
i pushed a fix, but then I hit close and comment. I think it made it through though? let me know if I need to do anything else on my end. Cheers!
You can hit "reopen" if you prematurely close it - I have now reopened it for you. But it appears there are still some kinks to work out