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;
|
let session:SessionUser | undefined;
|
||||||
if (session = validateSession(req.cookies)) {
|
if (session = validateSession(req.cookies)) {
|
||||||
const user = await UserService.GetUser(session.userId);
|
const user = await UserService.GetUser(session.userId);
|
||||||
|
if (user) {
|
||||||
const parties = await UserService.GetUserParties(session.userId);
|
const parties = await UserService.GetUserParties(session.userId);
|
||||||
const activeUserParty = await UserService.GetActiveParty(session.userId);
|
const activeUserParty = await UserService.GetActiveParty(session.userId);
|
||||||
if (user) {
|
|
||||||
return res.view("templates/home.ejs", { user, parties, activeUserParty });
|
return res.view("templates/home.ejs", { user, parties, activeUserParty });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue