Node.js With Passport Authentication | Full Project

Traversy Media · 866K views · 2018 · 1:24:56

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a worked example of Passport local authentication that they follow, adapt, or run into trouble with.

Recommended by 2 people across 2 different months, 2019 to 2020.

What it is

A Traversy Media project tutorial that builds a full authentication app with Node.js, Express, Passport, Mongoose and EJS templates. It covers user registration, login, session handling and route access control, with the finished code on GitHub.

What people said

Recommends Jonathan.B · 2019-10 · Stack Overflow · on “Issue in MongoAtlast database connectivity error”

@Striver79. Since it's hard for me to know where in the installation connection process you are and the objective of the project, the best I can give you is a demo guide. Of a plan that works, and you can reverse engineer or see where you went wrong. [this video] . His video is quite detailed in setting up and integration walkthrough.

Recommends HARDY8118 · 2020-11 · Stack Overflow · on “Receiving data from backend returns undefined”

serializing and deserializing will not store in session rather make your data usable for storing in sessions. What you should actually use is a session middleware in express. You can follow this [this video] tutorial or follow the github repo linked in description.

Cites Developer-ABC · 2020-08 · Stack Overflow · on “Unexpected token '/' in {FILE} while compiling ejs”

I am working on this: [this video] For some reason, the following line is causing the error in the title. <% include ./partials/messages %> Removing the line above solves the problem. I have confirmed that it is not the messages file as there are no slashes in it. <% if(typeof errors != 'undefined') { %> <% errors.forEach(function(error){ %> <%= error.msg %> <% }); %> <% } %>

Cites Christina Nguyen · 2020-09 · Stack Overflow · on “How to code login (passport) authentication for two different users types? Node.js”

I am new to Node.js. For my application, I have two different type of users being doctors and patient. Currently, I been coding for the login and registration for patients and it works. I starting to code the login for the doctors and it doesn't seem to be working. Below is the passport.js. I watched a video ( [this video] ) to learn how to code the login and registration. I think the issue is within the passport.js, I'm not really sure how to code it, when it comes to the second user. const LocalStrategy = require('passport-local').Strategy; const bcrypt = require('bcryptjs'); const Patient = require('../models/patients'); module.exports = function(passport) { passport.use( new LocalStrategy({ u

Cites John MacClain · 2020-09 · Stack Overflow · on “Node js Login API with Passport js”

I'm building an project witch having lots of API but I have login API too in this case I'm using passport local stratagy for it I followed this video Node.js With Passport Authentication | Full Project [this video] But now while making API I haven't rendering page I want to send json respose that will says that password wrong or user not found but in local stratagy has only success redirect and failure redirect don't ay option to send json reponse Please suggest me a secure technique to do that also I'm verifing email is verified or not and user banned or not.