All Questions
Tagged with authentication node.js
15 questions
2
votes
1
answer
105
views
Session-based authentication using Express.js
I'm currently learning Express.js and I wrote this authentication code. I'm unsure if what i have is correct, how to improve it and if it's secure. For user and session data storage I'm using ...
5
votes
1
answer
94
views
Basic node authentication system
I built a basic authentication system for a node application and I have some security concerns. The username and password the user enters when they log in are stored as plaintext using express-...
1
vote
1
answer
293
views
Private desktop and mobile WebSocket connections with Node.js
Background info
To learn a new branch of my dev career, I've started a new project in my spare time (I've never used WebSockets before and I also want to learn more about common authentication flows). ...
9
votes
1
answer
456
views
Node.js backend login logic
So I wrote a rather primitive login logic in Node.js, which authenticates the user and handles JWT. Is it any good in terms of security, efficiency, building, async/sync, logging. SECURITY is my main ...
3
votes
1
answer
1k
views
Crypto createCipheriv and createDecipheriv for authentication
I'm not an expert in authentication, so I want to make sure I have done everything right.
I am using crypto.createCipheriv and ...
7
votes
1
answer
622
views
nodejs 401 request retry mechanism
I'm working on a project in which I have a backend in nodejs and from there I need to call external APIs, those APIs require authentication token which is valid for 15 minutes. So if response status ...
4
votes
1
answer
62
views
Better code for error handling in NodeJs and Express
I have this code for a post request, when the user wants to change his password. Because of all the cases and the following page renders the code came out really ugly. Is there a better way to ...
4
votes
1
answer
668
views
Handling login using promises
We've got this node.js code which is called by an Express route:
...
4
votes
1
answer
2k
views
Express routing with a login action using SQLite
I'm new to Express and SQL, so I don't know the conventional ways of combining the two. Right now I have done it the following way:
...
1
vote
2
answers
541
views
JWT Authentication for REST API
Here is my code to implement authentication in a Node/Express/Sequelize project. This is my first time using JWT and I would appreciate any help!
...
2
votes
0
answers
71
views
Rewriting authentication controller using promises
I am in the process of refactoring some complex code that uses callbacks to instead use promises. I am trying to figure out if my proposed approaches make sense.
...
2
votes
1
answer
321
views
Is my Node/Express-based authentication implementation with session properly done?
I know that Passport.js exists, however, I wanted to code my own implementation using express-session module.
I'm using:
Express
Mongoose
express-session
So I basically have 2 routes for handling ...
3
votes
1
answer
109
views
User-logging authentication
I'm little frustrated because I don't know how well I can refactor this script. I wrote the authentication function but it's too complicated, maybe too large in one function, and seems like spaghetti ...
11
votes
1
answer
600
views
node.js Passport Wrapper 2
First attempt was done here:
My second attempt (now using jslint to make sure the spacing is correct and have incorporate the majority of the feedback from previous attempt).
...
11
votes
1
answer
582
views
node.js passport wrapper
I have started some experiments with node.js.
Any comment on style (especially the callbacks) and best practice is appreciated:
PassportControl.js
...