Skip to main content

All Questions

Tagged with
0 votes
1 answer
19 views

I am getting a "Bad Request" while login using my nodejs server but i am confused why i am getting this error. I am quite new to nodejs

passport.use(new LocalStrategy(async(email,password,done) => {    try{     const user = await User.findOne({email:email})     if(!user){        return done(null,false,{message:"Invalid email&...
Sujal Rawat's user avatar
0 votes
0 answers
22 views

oauth and manuall authentication in node.js

alright, I have a page where users can register using name, email, and password then log in using email and password, now I also want to authenticate using Google Oauth login, so how will that work ...
Aziz Ur Rehman's user avatar
2 votes
1 answer
33 views

Why check both req.isAuthenticated() and req.user in Passport Oauth 2.0 authentication?

Why check both req.isAuthenticated() & req.user for authentication in Passport Oauth 2.0? I believe req.isAuthenticated() alone is enough for social sign-in. I see others using both, but I don't ...
Rahul Kumar's user avatar
1 vote
0 answers
18 views

Redirecting to different routes according to user type

This is my express code, I'm handling authentication by passport.js and passport-local-mongoose, I've been having trouble redirecting different user type to their dashboard var express = require("...
Shree75's user avatar
  • 11
0 votes
0 answers
27 views

PassportJS login problem with failureRedirect: '/auth/login'

I have a project where I am making a login system with passport. I use nodejs and mysql. What happens is when i enter info and press login, it just failureRedirect: '/auth/login' without any logs. ...
KINGFOXL's user avatar
0 votes
0 answers
44 views

how to get a callback from discord desktop app

I am developing this web application that has a login to the workspace but after the user logs in successfully I want to make sure that he is running the discord app installed on his pc and is logged ...
Omar Zroud's user avatar
0 votes
0 answers
17 views

Passport-Discord dynamic uri

soooo basically im making this because in my code i dont want the discord auth (/auth/discord/callback) to try to redirect me to localhost:8080. Because the domain would be dynamic because this will ...
im just a 9th grader who codes's user avatar
0 votes
0 answers
21 views

Passport.js successRedirect doesn't load page, request keeps pending in signUp form

Im trying to write signUp proccess with passport.js local-strategy and it works and save user data in dataBase but it doesnt redirect me and keeps pending while the failureRedirect works well the ...
Mehranowsky's user avatar
0 votes
0 answers
28 views

The "local" function in passport.authenticate is not being invoked for some reason

const express = require('express'); const jwt = require('jsonwebtoken'); const passport = require('passport'); const localStrategy = require('passport-local').Strategy; const router = express.Router()...
Piyush Singh's user avatar
0 votes
0 answers
19 views

Unable to save session with passport.js after signing up

So, I am learning passport.js, everything seems to be working fine until, signing up a user. NOTE: I am just playing with json-server now, so no db. app.post('/signup', async (req, res) => { ...
bwongyh's user avatar
  • 58
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} = ...
Quatromic's user avatar
0 votes
0 answers
31 views

Trouble Sending JWT from Backend to Frontend after Google OAuth Login

I'm learning about authentication and JWT by building a small project. But I'm stuck trying to send the JWT (JSON Web Token) back to the frontend after a user logs in with Google OAuth. The problem is,...
Krichen Yassine's user avatar
-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 ...
SwineBurglar's user avatar
0 votes
1 answer
85 views

Nest can't resolve dependencies of the UserService (?). Please make sure that the argument "UserRepository" at index [0]

I am trying to develop a login flow using passport, but I am getting the following error. ERROR [ExceptionHandler] Nest can't resolve dependencies of the UserService (?). Please make sure that the ...
Muhammad Owais's user avatar
0 votes
0 answers
28 views

After redirection from the server, a 'Cross-Origin Request Blocked' error is encountered in Next 14

I'm using Next.js 14 with Express and attempting to implement Google OAuth using passport-google-oauth2. However, I'm encountering an error on my frontend. When my server sends a redirection link to ...
iamWinn1 's user avatar

15 30 50 per page