Heeyeon

Fixing bugs

......@@ -114,7 +114,10 @@ app.get('/logout',(req,res)=>{
//로그인 로그아웃 여부
const authInfo = (req)=>{
if(req.user) return `${user.name} | <a href="/logout">로그아웃</a>`;
if(req.user)
{
return `${user.name} | <a href="/logout">로그아웃</a>`;}
else
return `<a href="/login">로그인</a>`;
}
......@@ -154,11 +157,30 @@ function (accessToken, refreshToken, profile, done) {
/*--------------------회원가입 처리---------------------- */
//회원가입 처리 Post
var user = {};
app.post('/join',(req,res)=>{
user.email = req.body.email;
user.password = req.body.password;
user.name=req.body.name;
//로그인 페이지로 이동
console.log(user);
res.redirect('/login');
});
//회원가입 페이지 Get
app.get('/join',(req,res)=>{
let page = getPage('회원가입',`
<html>
<head>
<script> function congratulation()
{
alert("새로운 회원이 되신걸 축하합니다!:D \n 레시피 찾을 준비 되셨나요?");
} </script>
<style>
body {
padding-top: 15px;
......@@ -208,10 +230,7 @@ app.get('/join',(req,res)=>{
</style><link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script> function congratulation()
{
alert("새로운 회원이 되신걸 축하합니다!:D \n 레시피 찾을 준비 되셨나요?");
} </script>
</head>
<body>
......@@ -235,6 +254,7 @@ app.get('/join',(req,res)=>{
</button>
</form>
</html>
`,'<a href="/login">뒤로가기</a>');
res.send(page);
});
......
{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"flash":{"error":["Missing username or password."]},"__lastAccess":1638446277022}
\ No newline at end of file