All Questions
244
questions
0
votes
0
answers
19
views
(Passport JWT & NestJS) Token expired is blocked due having ignoreExpiration: true
I have a rt strategy and I don't want to check if the token is expired, I just want to verify it. I have declared in the super the ignoreExpiration a true but it stills give me a 401 and doesn't even ...
0
votes
0
answers
28
views
Passport.js JWT Typescript Conflict with req
middleware:
import { Response, NextFunction } from 'express';
import { Role } from '@prisma/client';
import { IUserRequest } from '@/interfaces/custom-request.interface';
export const verifyRoles = (....
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,...
0
votes
0
answers
24
views
How can i set a localstorage of my Token when google Auth is done?
I tried to add a localStorage of my token when the process is done so i can get it in my react component (let tok = localStorage.getItem('jwtGoogleToken');)
like this :
if (account.enable === true) {
...
1
vote
1
answer
28
views
Continous Unuathorised message response on using authguard in nest .js
I am trying to use the authguard here in nest js but i am getting this unauthorized error constantly , let me share all the codes here
//auth service
import { Injectable, UseFilters } from '@nestjs/...
0
votes
0
answers
351
views
Google authentication with passport in node.js. How to generate my own jwt token after successful login?
Here are all the resources I've based to build my solution/strategy for this:
https://medium.com/free-code-camp/how-to-set-up-twitter-oauth-using-passport-js-and-reactjs-9ffa6f49ef0
https://medium.com/...
0
votes
0
answers
15
views
Use token but alert unauthorized
I use the express,passport,jwt to achieve restricted access using tokens.
The login interface generate token suceessfully,but when I use getKind interface whith rigth token,it alert me unauthorized.
...
0
votes
2
answers
280
views
Should I query the database for the JWT user in the middleware in Express.js?"
I have a Node.js application where I'm using Passport.js with JWT strategy. After providing a JWT to the client, the user may become a canceled user. However, since they obtained the JWT beforehand, ...
0
votes
0
answers
33
views
How to redirect a user to chrome extension tabs page from NodeJS?
I'm working on an extension (MV3) and I'm using Passport.JS to authenticate users with Google. I'm using JWT which I need to send to the frontend. When I try to use the following code to redirect the ...
0
votes
0
answers
39
views
How do you store a login session to be used in another route node express passport jwt mongoose
I'm trying to build a route that will allow the logged in user to change their password. I have a register new user and login route that is working alright, but I don't know how to store that token ...
2
votes
0
answers
634
views
NestJS Returning an Empty Object When I try to generate JWT token
I am trying to use jsonwebtoken with NestJs, and have been battling with this issue whereby NestJS returns an empty object once it encouters my code line to generate a token.
Each time, I try to ...
0
votes
1
answer
316
views
500 Internal Server Error in passport-facebook-token implementation using Node.js and express.js
I'm implementing facebook-auth using https://www.npmjs.com/package/passport and https://www.npmjs.com/package/passport-facebook-token npm packages
this is my code in the passport config file:
passport....
0
votes
1
answer
733
views
Why to use Passport.js along with jwt to authenticate user when we can do this jwt alone
I have seen multiple online tutorial which are using Passport.js along with json web token for authentication purpose.
My question is why we needs to use passport.js when we can use only use jwt to ...
1
vote
1
answer
467
views
Login functionality from external API in React with Node.js
I’m having trouble figuring out how to get Node.js backend tokens into React.js frontend local storage. To login a user will use their credentials though an external websites API using the Oauth2 flow,...
0
votes
0
answers
237
views
PassportJS JWT: protected-route is Unauthorized in my browser , but Authorized on Postman
I'm trying to implement JWT authentication, and I can't figure out why in Postman protected-route is available, while in my browser protected-route is Unauthorized.
I'm a beginner and its first time ...