How do I write a user login system with JavaScript?
Using jwt
Send username and password to server. Use ajax or just plain post request.
sudo codeif user == "user1" && password == "password1":
login("user1")
else if user == "user2" && password == "password2":
login("user2")
...
else:
return false
>>57523438
that doesn't look very secure
>>57523406
php
>>57523571
Just change the variable names so it's harder for the hackers to figure out what the code does, client side.
client side crypto libs exist like aes and bcrypt
why would you write it with JS?
Why would u even write this in javascript clientside, do it server side
>>57523628
That does not sound like a safe solution. Would be better to check it somewhere else.
Do I even need a SQL DB if all I need to store is a dozen users ?
I want thinking of just having a text file server side with some synthax like
username:pwd:arg1:arg2:etc..
>>57524421
>Do I even need a SQL DB
Of course not.
You should be using MONDODB like the rest smart individuals who write js.
>>57523406
>Do I even need a SQL DB if all I need to store is a dozen users ?
>
>I want thinking of just having a text file server side with some synthax like
>username:pwd:arg1:arg2:etc..
Use noSQL
>>57524258
So, theoretically, if someone was new to these programmings, how would someone go about writing it server side?
>How do I write a user login system with JavaScript?
Except it runs on the server side, you don't.
It will be insecure as fuck
>>57524440
>MONDODB
Is proper typing that hard on a macbook?
>javascript
>2016
>>57524808
this.
Trumpscript will BTFO JS
>>57523406
D O N T
D O
T H I S
https://www.youtube.com/watch?v=8ZtInClXe1Q
npm install passport
you'll figure out the rest
>>57523438
Hard coding every user in.
Might as well off yourself.
>>57524288
It's completely safe, just trust me.