Akhidjon

Setting up routes

......@@ -47,6 +47,7 @@ var mytoons = require('./routes/mytoons');
var yourtoons =require('./routes/yourtoons');
var setting = require('./routes/setting');
// 최초 로그인 성공시 (Strategy 성공시) 단 한번만 호출
passport.serializeUser(function(user, done) {
console.log('serialized');
......@@ -97,6 +98,7 @@ app.use('/users', users);
app.use('/mytoons', mytoons);
app.use('/setting', setting);
app.use('/yourtoons', yourtoons);
app.use('/login', require('./routes/login')) // added new login page
// catch 404 and forward to error handler, for wrong page
app.use(function(req, res, next) {
......
......@@ -125,6 +125,11 @@ function loginByThirdparty(info, done) {
});
}
router.get('/login', function(req,res){
res.render('login_page')
})
// 라우터 설정, 카카오
router.get('/auth/logout/kakao',function (req,res) {
req.logout();
......
var express = require('express');
var cheerio = require('cheerio');
var request = require('request');
var mysql = require('mysql');
var client = require('cheerio-httpcli');
var passport = require('passport');
var KakaoStrategy = require('passport-kakao').Strategy;
var NaverStrategy = require('passport-naver').Strategy;
var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;
var router = express.Router();
router.get('/login', (req,res)=> res.render('login_page'));
module.exports = router;
......@@ -47,9 +47,7 @@
<ul class="nav navbar-nav navbar-right">
<li><a href="#about" class="page-scroll">About</a></li>
<li><a href="#portfolio" class="page-scroll">Webtoons</a></li>
<li><a href="/auth/login/kakao" class="page-scroll">kakaoLogin</a></li>
<li><a href="/auth/login/naver" class="page-scroll">naverLogin</a></li>
<li><a href="/auth/login/google" class="page-scroll">googleLogin</a></li>
<li><a href="/login" class="page-scroll">Login</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
......