Skip to content
Snippets Groups Projects
Commit 568973fb authored by nahyun's avatar nahyun
Browse files

fix: fwt 토큰 access and refresh토큰 분리+https 인증

parent ac3908a6
No related branches found
No related tags found
3 merge requests!18Secure,!17Secure,!16Secure
......@@ -97,16 +97,6 @@ app.use('/del_user', authenticateToken, deleteUser);
console.log('GOOGLE_CLIENT_ID:', process.env.GOOGLE_CLIENT_ID);
console.log('GOOGLE_CLIENT_SECRET:', process.env.GOOGLE_CLIENT_SECRET);
// // MongoDB 연결
// mongoose.connect('mongodb://localhost:27017/logininfo', {
// useNewUrlParser: true,
// useUnifiedTopology: true,
// }).then(() => console.log('MongoDB 연결 성공'))
// .catch(err => console.error('MongoDB 연결 오류:', err));
// application/x-www-form-urlencoded
app.use(express.urlencoded({ extended: false }));
......@@ -140,7 +130,7 @@ app.get('/googlelogin',
passport.authenticate('google', { scope: ['profile', 'email'], session: false })
);
//jwt 전--------------------------------------
//세션 로그인 -------------------------------------
// app.get('/googlelogin/redirect',
// passport.authenticate('google', { failureRedirect: '/' }),
// (req, res) => {
......@@ -194,7 +184,6 @@ app.get('/googlelogin/redirect',
sameSite: 'Strict',
maxAge: 7 * 24 * 60 * 60 * 1000 // 7일
});
//res.redirect(`http://localhost:3000/login#token=${token}`);
res.redirect('https://localhost:3000/');
console.log(`구글 로그인 성공: ${req.user.email}`);
}
......@@ -280,20 +269,13 @@ app.get('/dashboard', authenticateToken, (req, res) => {
`);
});
// // 홈
// app.get('/', (req, res) => {
// res.send(`
// <h1>Google OAuth Login</h1>
// <a href="/googlelogin">Login with Google</a>
// `);
// });
//signup 경로
app.get('/signup', (req, res) => {
res.sendFile(__dirname + '/public/signup.html'); // login.html 파일 경로 설정
});
//session
//session 로그인
// app.get('/conf_password', (req, res) => {
// if (req.isAuthenticated && req.isAuthenticated()) { // 로그인 여부 확인
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment