Skip to Content
한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
book

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

by 한선용, 이선 브라운
May 2021
Beginner to intermediate
448 pages
9h 47m
Korean
Hanbit Media, Inc.
Content preview from 한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
336
한 권으로 끝내는 Node & Express
name: profile.displayName,
created: new Date(),
role: ‘customer’,
})
.then(user => done(null, user))
.catch(err => done(err, null))
})
.catch(err => {
console.log(‘whoops, there was an error: ‘, err.message)
if(err) return done(err, null);
})
}))
registerRoutes
메서드에는 다음을 추가합니다.
app.get(‘/auth/google’, (req, res, next) => {
if(req.query.redirect) req.session.authRedirect = req.query.redirect
passport.authenticate(‘google’, { scope: [‘profile’] })(req, res, next)
})
app.get(‘/auth/google/callback’, passport.authenticate(‘google’,
{ failureRedirect: options.failureRedirect }),
(req, res) => {
// 인증에 성공했을 때만 여기에 도달합니다. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

한성용, 이선 브라운

Publisher Resources

ISBN: 9791162244227