Really crappy code used to make login page won't work (What a suprise)

My project name is https://samhamsemporium.glitch.me/
you press the button and get sent to /trolled and press login or register then you get sent to /login or /register and the enter some form data and when you press submit, that’s where the problem starts. Now I don’t know where I messed up and how but I barely even understand my own code and some of it was made in chat gpt so I don’t see where the problem even starts. If you can help I’d appreciate this a lot.

What I’m trying to get it to do is make it go to /home when the credentials are correct.

1 Like

There are multiple bugs on your code, but I think that for the “/admin” route (file server.js, line 143) you should use “app.post” and not “app.get”.

It dosen’t work.

The code seems working OK, just confirm that you are entering the correct key. Also, I hightly recommend that you put your registrations.db in your .gitignore, else anyone can read them.

Alright thank you but, how would I do that?

Create a .gitignore file with the contents:

registrations.db

Like just put “registrations.db” in text in the .gitignore file or what

Like just put “registrations.db” in text in the .gitignore file or what

?

Yes, put the text “registrations.db” in the file .gitignore

2 Likes

I can go to the /login page but when I actually login it won’t go to the /home page

I used res.redirect("/home") but that wont work
/home wont work at all even when I put it in my browser so I switched it to be /trolled(which works in the browser) but it does the same thing as /home

To which if I wait like 2 minuets it will respond with

Nevermind, I just had to put Return return res.redirect("/trolled");

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.