-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Session now fully functioning - can also logout
- Loading branch information
Sarah Weeks
authored and
Sarah Weeks
committed
Feb 28, 2020
1 parent
3895b3d
commit 499a777
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const session = require("../models/session"); | ||
|
||
function getSessions(userID) { | ||
return new Promise((resolve, reject) => { | ||
session.find({}, (err, docs) => { | ||
for (const session of docs) { | ||
console.log(session); | ||
if (JSON.parse(session.session).userID == userID) { | ||
resolve(true); | ||
return; | ||
} | ||
} | ||
resolve(false); | ||
return; | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = getSessions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div class="contentContainer"> | ||
|
||
|
||
{{logout}} | ||
</div> |