All Questions
288
questions
0
votes
1
answer
29
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 ...
0
votes
0
answers
46
views
Keep getting TypeError: Cannot set properties of undefined (setting 'user')
I'm new to Nodejs and Express server. I'm trying to create a webapp where user can log in with their Gmail. My front-end uses Reactjs. However, I keep getting this error TypeError: Cannot set ...
0
votes
0
answers
21
views
React.js Passport.js session and cookie problem
That's my db session also passport.js configuration in index.js file:
const connect = async () => {
try {
await mongoose.connect(process.env.DB_URL);
console.log("Connected ...
0
votes
0
answers
13
views
Backend says isAuthenticated is true/ frontend says isAuthenticated is false
Im using passport js google oauth20. Upon fetching from the backend and console.logging the data I get false. I'm not sure what's causing this
Frontend
const [isauthenticated, setIsAuthenticated] = ...
1
vote
0
answers
72
views
Credentials problem in Vite.js application (passport.js)
When I send POST request from Vite.js app (localhost:5173) to backend I get correct response but my data doesn't come. I mean My request goes correctly but the data is not coming
Hello, first of all ...
0
votes
0
answers
42
views
Implementing a login system using react and passport local
Im currently trying to set up a login authentication for react using a passport local strategy.
Here is the code:
The authentication code:
const passport = require('passport')
const {Strategy} = ...
-2
votes
1
answer
49
views
Express doesn't redirect to react-router root path after successful MongoDB save - fails silently - how to redirect successfully?
I'm a novice with React and react-router, so I'm probably making a silly mistake.
I'm building a web app with React and react-router as the frontend server, and Express with MongoDB as the backend ...
0
votes
1
answer
18
views
my express backend which uses passport.js is returning false on the client but true when I go to the server using the browser
this is my express backend
which has a '/check-auth' api endpoint that returns authenticated: true on the server
but when I am on using the react client returns authenticated: false
const express = ...
0
votes
1
answer
142
views
Cookie from Express app not set when fetching in Next app
I have an app that's built on react/next and a server built on express.
The basic flow is that a user authenticates via Github Oauth using passport.js, the server then returns a connect.sid cookie ...
0
votes
1
answer
140
views
Redirect from Express js throwing CORS errors in React/Next
I'm having a lot of trouble with CORS. I have an express server deployed on my domain, and am currently developing a react app locally on localhost:3000.
When I try to redirect after logging out with ...
0
votes
0
answers
31
views
Google auth not working on production , but working perfectly on localhost
Implemented Google auth strategy using passport.js on Node.js . It works perfectly fine on localhost
but when I try on deployment it keeps on giving me URL_MISMATCH . even when i have correctly put ...
1
vote
1
answer
48
views
Cant access protected resources even after successful login ( passport oauth2.0 google sign in )
Facing Trouble making protected Resources accessible to Logged in users ( oauth2 google passport.js )
I am able to login and then get redirected to the protected page ( on the frontend).
But when the ...
0
votes
1
answer
102
views
AzureAD - I'm having issues with retrieving user information, specifically the employee number, when I authenticate through AzureAD
I have a React front-end that authenticates the user and obtains an access token with the scope for my API. I use this token to validate the session when making requests in my back-end, and I was able ...
0
votes
2
answers
414
views
401 Unauthorized user not found node/mongo
Hey I am trying to make a simple auth login system using mongodb and passport.js, the signup works, the problem is with the login. I have searched the world wide web for an answer but can't seem to ...
1
vote
1
answer
121
views
issues importing function in node/js
Hey I am having troubles importing the function "generateToken"
import jwt from "jsonwebtoken";
function generateToken(user) {
// Generate and return jwt token
const token = ...