{"size": 571, "ext": "js", "max_stars_repo_path": "backend_server/login_scripts/verifyLogin.js", "max_stars_repo_name": "andersonxanna/hatch-calendar", "max_stars_repo_stars_event_min_datetime": "2021-06-30T17:18:53.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-30T17:18:53.000Z", "max_issues_repo_path": "backend_server/login_scripts/verifyLogin.js", "max_issues_repo_name": "andersonxanna/hatch-calendar", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend_server/login_scripts/verifyLogin.js", "max_forks_repo_name": "andersonxanna/hatch-calendar", "max_forks_repo_forks_event_min_datetime": "2021-06-01T02:43:53.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-01T02:43:53.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.7916666667, "max_line_length": 58, "alphanum_fraction": 0.6672504378}
import passport from 'passport';
import passportLocal from 'passport-local';
//Verifies if user is logged in or not
//Will help to mainatain user login when later implemented
function isLoggedIn(req, res, next){
    if(req.isAuthenticated()){
        return next();
    }else{
        res.send("Unauthorized");
    }

}
//Checks if user isn't loggged in
function notLoggedIn(req, res, next){
    if(!req.isAuthenticated()){
        return next();
    }else{
        res.send("Already authorized");
    }
}

const funcs = { isLoggedIn, notLoggedIn }

export default funcs;