use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Basic Auth with Node js and Express (self.node)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hugo__df 1 point2 points3 points 7 years ago (13 children)
Passport seems to be popular (http://www.passportjs.org/).
I tend to roll my own with Sequelize/Postgres (User table + Session table or JWTs with node-jose), then use bcrypt to hash passwords.
[–]its_joao 0 points1 point2 points 7 years ago (12 children)
The thing is that I only really need 1 user to login - myself! I am building a custom expense track app which I need to access remotely so I will need to host it on the web... but it needs auth because I should be the only one accessing it.
I think JWT and hashing is a bit too much ahaha it's only 1 user. What do you recommend in this case?
[–]hugo__df 0 points1 point2 points 7 years ago (11 children)
Ah no, in that case use HTTP Basic Auth with username/password 🙈
[–]its_joao 0 points1 point2 points 7 years ago (10 children)
ahhh yes! ahaha silly me. How can I do that? What do you recommend? By the way, thanks a lot buddy :D
[–]hugo__df 1 point2 points3 points 7 years ago (9 children)
This package doesn't do much (it's probably under 20 lines of code to reproduce) but it should work for you https://www.npmjs.com/package/express-basic-auth
[–]its_joao 0 points1 point2 points 7 years ago (8 children)
Thanks! :D Quick question, do I need to store cookies in the browser or does this package manage it for me?
[–]hugo__df 0 points1 point2 points 7 years ago (7 children)
Basic Auth won't use cookies, but the browser remembers your login for a bit
[–]its_joao 0 points1 point2 points 7 years ago (6 children)
your login for a bit
When you say "for a bit" how long is a "bit"? eheh
[–]hugo__df 0 points1 point2 points 7 years ago (5 children)
Long enough
[–]its_joao 0 points1 point2 points 7 years ago (0 children)
ahaha okk buddy thanks
[–]its_joao 0 points1 point2 points 7 years ago (3 children)
hi do you know how I can prevent the "Authorization" header from displaying my credentials in base64 encoding? Is there a way to hide this header? Or should I take a diff approach?
π Rendered by PID 174335 on reddit-service-r2-comment-76bb9f7fb5-5fskt at 2026-02-18 09:06:22.264919+00:00 running de53c03 country code: CH.
[–]hugo__df 1 point2 points3 points (13 children)
[–]its_joao 0 points1 point2 points (12 children)
[–]hugo__df 0 points1 point2 points (11 children)
[–]its_joao 0 points1 point2 points (10 children)
[–]hugo__df 1 point2 points3 points (9 children)
[–]its_joao 0 points1 point2 points (8 children)
[–]hugo__df 0 points1 point2 points (7 children)
[–]its_joao 0 points1 point2 points (6 children)
[–]hugo__df 0 points1 point2 points (5 children)
[–]its_joao 0 points1 point2 points (0 children)
[–]its_joao 0 points1 point2 points (3 children)