Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
0 answers
19 views

Passport.js Error Handling Instead of throwing the error into stdout

So I Have The Current Code For Authorization (and im probably going to merge login with signup): Strategy: const passport = require("passport") const { Strategy } = require("passport-local") const ...
AmirparsaDD's user avatar
0 votes
1 answer
32 views

passport.deserializeUser function never getting called

Passport's deserialization just does not work no matter what I do. This is my passport.js: const passport = require('passport'); const GoogleStrategy = require('passport-google-oauth20').Strategy; ...
hypedstan's user avatar
0 votes
0 answers
32 views

NPM passport issue

I am using NPM package passport router.get("/login", (req, res) => { res.render("users/login.ejs"); }); router.post( "/login", (req, res) => { ...
Sparsh Maheshwari's user avatar
0 votes
1 answer
18 views

Login Redirection Issue in Express.js with Passport Authentication

I am developing an Express.js application and facing a persistent issue with user authentication. Despite successful user registration and confirmed entries in the database, the login process does not ...
Ricardo Luna's user avatar
0 votes
0 answers
37 views

passport login issues in session

I'm having trouble with my passport. The login process went through without any issues, but the passport key has to be saved into the session and there is not req.user in the requset the initapp ...
Yossef Sabry's user avatar
0 votes
1 answer
27 views

How do I specify which HTTP method should be used in a redirect in my express application?

I have a NodeJS/Express application where I am using PassportJS for authentication. I have the following routes: router.get("/profile", isUser, (req, res) => { res.render("profile&...
Oscar R's user avatar
  • 452
0 votes
0 answers
22 views

How to Configure Google Auth Redirect URI for a Node.js Application on AWS EC2?

I'm currently deploying a Node.js application that uses Google OAuth 2.0 for authentication on an AWS EC2 instance. However, when users attempt to log in using Google, they receive an "access ...
ASHWIN C's user avatar
0 votes
1 answer
73 views

Getting "401 Unauthorized" when accessing protected route in Express.js with express-session and passport

I'm building a blob web application using Express.js where users can log in and access protected routes. I've set up session management using express-session and authentication with passport-local. ...
elclasico's user avatar
-1 votes
0 answers
17 views

Google oauth redirect URL is react routed page. How can I use passport.authenticate middleware to extract user info?

passport.use( new GoogleStrategy({ clientID:"xyz.apps.googleusercontent.com", clientSecret:"xyz", callbackURL:'http://localhost:5173/loggedin' }, ...
Shrikrishna Sawangikar's user avatar
0 votes
1 answer
33 views

Cookie not setting in Express with Passport JS

I am using Passport JS for authentication for my MERN app. I am trying to have routes that are protected so you must be authenticated. When I test the routes and /login in Thunder Client and then try ...
jc22920's user avatar
  • 348
0 votes
1 answer
47 views

Mongoose CastError: Cast to ObjectId failed for Twitter ID (type string)

I’m working on a content syndication project where I’m implementing Twitter authentication using Passport.js and Mongoose. The authentication flow works up to the point of deserializing the user. I’m ...
Belmin's user avatar
  • 1
0 votes
1 answer
45 views

Login route returns "Cannot POST /login" - implementing Passport in MERN

I am trying to implement Passport into my MERN application, registering users and all other routes work but whenever I hit the /login POST route I get Cannot POST /login (see image below). This only ...
jc22920's user avatar
  • 348
0 votes
0 answers
25 views

NODE + PASSPORT + GOOGLE STRATEGY: req.user not being persistent and connect.sid not being sent in production environment

I'm working on a MERN stack project and I'm facing this issue where my req object is not being persistent and holding the req.user after it has been authenticated. when the /google/callback enpoint is ...
Amaan's user avatar
  • 5
0 votes
1 answer
32 views

Express request does not inlcude user after passport (local strategy) authentication

Question: I try to authenticate http requests via username and password. The authentication seems to work. But for some reason the user data is not available inside the express routes. Related ...
quentinkrammer's user avatar
0 votes
1 answer
31 views

Passport JS and express-session: req.isAuthenticated() false in production , returns true in development

I am responding to request from client for protected resources based on whether the req.isAuthenticated() flag returns true or false I am hosting my app on render When i had completed the initial ...
DaObliterator's user avatar

15 30 50 per page
1
2 3 4 5
216