don't get parties or activeparty if we don't have a valid user
This commit is contained in:
parent
86269e624b
commit
70f23d750b
1 changed files with 2 additions and 2 deletions
|
@ -81,9 +81,9 @@ fastify.get("/", async (req, res) => {
|
|||
let session:SessionUser | undefined;
|
||||
if (session = validateSession(req.cookies)) {
|
||||
const user = await UserService.GetUser(session.userId);
|
||||
if (user) {
|
||||
const parties = await UserService.GetUserParties(session.userId);
|
||||
const activeUserParty = await UserService.GetActiveParty(session.userId);
|
||||
if (user) {
|
||||
return res.view("templates/home.ejs", { user, parties, activeUserParty });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue