Hello, I am have two issues with my web app. Right now I am trying to get login and reset password to work properly in this small project so that I can implement it into my main web app afterwards. It’s just simple project with an index page, and you can login, logout, access an admin page and reset password. Before anyone mentions it, I am not using a database to store the user because the teacher wants it in a CSV file.
GitHub Project: https://github.com/stunt296/login_practice
Here are the two issues:
When clicking Submit on the Forgot password page, it redirects me to random pages…Sometimes it’s /login_success and sometimes it’s /admin from what I’ve seen so far. It should be going to /forgot_success. The password in the CSV file is getting changed though.
Ever since I built the Forgot password page and used it to change the value in the CSV file, my Login page doesn’t work properly anymore. When inputting the wrong password/user combination, it should flash ‘Incorrect user/pass’ but instead it gives me this error:
File “C:\Users\MobileKlinik\PycharmProjects\untitled1\app.py”, line 45, in check_password
if username == user and password == user:
IndexError: list index out of range
Again, this only started happening AFTER making the Forgot password page and using it to change the password in the CSV file. Very strange…
If anyone can help me fix these issues, I’d greatly appreciate it. Thanks!