Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dylan Fixing Issues #28

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ if (app.get('env') == 'development') {
app.use(errorHandler());
}
// Introduce Token

/*
var token = 'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9';
console.log('token: ' + token);
*/

http.createServer(app).listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
Expand Down
7 changes: 4 additions & 3 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports.index = function (req, res, next) {
};

// Insert new vulnerable code:

/*

exports.loginHandler = function (req, res, next) {
if (validator.isEmail(req.body.username)) {
Expand Down Expand Up @@ -69,7 +69,7 @@ if (validator.isEmail(req.body.username)) {
} else {
return res.status(401).send()
};

*/

function adminLoginSuccess(redirectPage, session, username, res) {
session.loggedIn = 1
Expand Down Expand Up @@ -208,7 +208,7 @@ exports.create = function (req, res, next) {
};

// Insert new vulnerable code:

/*
exports.destroy = function (req, res, next) {
Todo.findById(req.params.id, function (err, todo) {

Expand Down Expand Up @@ -249,6 +249,7 @@ exports.update = function (req, res, next) {
});
});
};
*/

// ** express turns the cookie key to lowercase **
exports.current_user = function (req, res, next) {
Expand Down