Skip to content

Commit

Permalink
fixed scoping issue with users
Browse files Browse the repository at this point in the history
  • Loading branch information
snollygolly committed Aug 10, 2018
1 parent df62761 commit fb83bd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions controllers/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

const config = require("../config.json");

let user = null;

module.exports.login = async(ctx) => {
let user;
if (ctx.isAuthenticated()) {
user = ctx.session.passport.user;
}
Expand All @@ -19,6 +18,7 @@ module.exports.logout = async(ctx) => {
};

module.exports.index = async(ctx) => {
let user;
if (ctx.isAuthenticated()) {
user = ctx.session.passport.user;
} else {
Expand Down
3 changes: 1 addition & 2 deletions controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

const config = require("../config.json");

let user = null;

module.exports.index = async(ctx) => {
let user;
if (ctx.isAuthenticated()) {
user = ctx.session.passport.user;
}
Expand Down

0 comments on commit fb83bd3

Please sign in to comment.