Toggle navigation
Toggle navigation
This project
Loading...
Sign in
What2Do
/
What2Do
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이선호
2021-12-03 09:39:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a560a81fca8e83bb98b0ac14ea890c169d24f526
a560a81f
1 parent
5df8685c
Revert "add the find spot and auto"
This reverts commit
5df8685c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
app/routes/login.js
app/views/users.ejs
app/routes/login.js
View file @
a560a81
...
...
@@ -6,8 +6,9 @@ var bodyParser = require("body-parser");
//app.use(bodyParser.urlencoded({ extended: true }));
//app.use(bodyParser.json());
var
router
=
express
.
Router
();
var
jsonParser
=
bodyParser
.
json
();
var
urlencodedParser
=
bodyParser
.
urlencoded
({
extended
:
false
});
var
jsonParser
=
bodyParser
.
json
()
var
urlencodedParser
=
bodyParser
.
urlencoded
({
extended
:
false
});
// 로그인 라우터 함수 - 데이터베이스의 정보와 비교
router
.
post
(
"/"
,
urlencodedParser
,
function
(
req
,
res
)
{
...
...
@@ -27,7 +28,7 @@ router.post("/", urlencodedParser, function (req, res) {
//console.dir(docs);
var
username
=
docs
[
0
].
name
;
console
.
log
(
username
);
req
.
session
.
islogined
=
true
;
req
.
session
.
islogined
=
true
;
req
.
session
.
userid
=
paramId
;
req
.
session
.
username
=
username
;
// res.writeHead("200", { "Content-Type": "text/html;charset=utf8" });
...
...
@@ -65,6 +66,7 @@ var authUser = function (database, id, password, callback) {
}
console
.
log
(
"아이디 [%s], 비밀번호 [%s]로 사용자 검색 결과"
,
id
,
password
);
//console.dir(results);
if
(
results
.
length
>
0
)
{
console
.
log
(
"일치하는 사용자 찾음."
,
id
,
password
);
...
...
app/views/users.ejs
View file @
a560a81
...
...
@@ -28,7 +28,7 @@
<body>
<h3>
Login Success
</h3>
<h2></h2>
<!--<a href="/auth/logout">Logout</a>-->
<a
href =
"/auth/logout"
>
Logout
</a>
<a
href=
"/map"
>
Map을 들어가보자
</a>
...
...
Please
register
or
login
to post a comment