Using node v12, Express 4, and connect-pg-simple
During our security evaluation is was discovered that if a user logs in successfully, and logs in again successfully, that the prior session remains valid.
I'd like for the second login to revoke the…
I am using express-session with Express 4. I am confused about how I pass the secret from the client to the server. I assume that I need to pass the secret for every request, otherwise I don't really understand what the secret is for.
var session =…
I have a page and I want to track what the current user is doing. For this, the server gives him an id, and than, I'd like to send a XmlHttpRequest to log information, and I'd like to keep its id.
However, the request received by my server as an…
Here's the code:
app.get('/vklogin', function(request, response) {
console.log('Авторизация через соц.сеть "Вконтакте"'.green);
var url_parts = url.parse(request.url, true);
var query = url_parts.query;
var data = querystring.stringify({
…
I have Express with Passport authentication and have added session to it as below.
app.use(cookieParser()); // read cookies (needed for auth)
app.use(bodyParser()); // get information from html forms
app.set('view engine', 'ejs'); // set up ejs for…
I am creating a login application where I need to redirect back to previous url from where the login action was called. I need to know does sails provide a built-in method by using which I can redirect to previous action without creating my own…
Do i need to install express-session every time I use passport nodejs?
I was following a tutorial on using Oauth (Google) with Passport.js and Nodejs, The Net Ninja one
And He didn't mention express-session and it worked for him
When I tried it it…
I am working on a simple Todo web application, and I am stuck in authorisation. I want to protect all my routes by having an active user session.
When doing an API call to a POST route, I keep getting undefined for req.session.userId within the…
I have intigrated the sslcommerz payment gateway but when I am completing my transaction successfully, instead of redirecting me in the dashboard page, it is throwing the following error:
UnhandledPromiseRejectionWarning: TypeError: Cannot read…
So, I've implemented some form of auth on my API, I'm not sure which kind it classifies as.
What my app does is, it generates a token once a user signs up/logs in and then before every endpoint call, I have a middleware function that checks if a…
I'm in the middle of making a login system, with nextJS, and Mysql. I wanted to use sessions to login the user, but don't know how to combine express-session with NextJS. My question is, can express-session be used with NextJS, if so how?
my code works
but whenever i made a change in the server.js, the req.session.user turns undefined.
This also happens the first time i make a request from the front, i do get authenticate. but right after i dont get the user.name and cookie cause it…
I'm trying to save a session when I log in but, when I try to sign in I get the error TypeError: Cannot read property 'save' of undefined. I am using express-session's req.session.save({}) method when I get the error. what is wrong with my code and…
I am trying to use apollo-server-express to maintain a graphql endpoint and other endpoints to perform oAuth with twitter. I wanted to perform the oauth in the client in a way that a browser tab opens and a socket transmits a "MESSAGE" (as an…
I'm not sure what I did wrong
Last project before this was fine, session is saving / persisting
Stack: MEAN
Node version: v14.15.0
Express version: v4.17.1
Express session version: v1.17.2
app.ts
// ...
_session: typeof expressSession =…