auth1 [Node.js] Passport 모듈을 이용한 로그인 구현 1 - 모듈 설치 / 준비 Node.js 모듈 중에는 Passport라는 모듈이 있습니다. 이 모듈을 사용하면 로그인 시에 인증을 보다 쉽게 구현할 수 있습니다. 프로젝트를 다음과 같이 구성합니다. 코드를 다음과 같이 입력합니다. /models/User.js const mongoose = require('mongoose'); const Schema = mongoose.Schema; // create schema const UserSchema = new Schema({ email: { type: String, required: true }, password: { type: String, required: true }, name: { type: String, required: true } }); module.exports = User.. 2019. 1. 29. 이전 1 다음