Skip to content

Commit

Permalink
Redirecting to previous page after login(KamandPrompt#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjali142 authored Jun 30, 2019
1 parent 15d5175 commit 714821e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controls/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var passport = require('passport');
var user = require('../models/users');
var submissions = require('../models/submission');
var moment = require("moment");
var back = require("express-back");

/**POST: user signup
* route: /user/signup
*/
exports.postSignUp = function (req, res) {
var url = req.url;
user.findOne({ username: req.body.username })
.then((data) => {
console.log(data);
Expand Down Expand Up @@ -79,7 +79,7 @@ exports.postLogin = function (req, res) {
*/
exports.getLogout = function (req, res) {
req.logout();
res.redirect('back');
res.redirect('url');
}

/**Implementing the routing guards */
Expand Down

0 comments on commit 714821e

Please sign in to comment.