diff --git a/index.js b/index.js index 58c60d834..1ad0ac446 100644 --- a/index.js +++ b/index.js @@ -115,7 +115,7 @@ let sess = { secret: process.env.SESSION_SECRET, resave: false, saveUninitialized: false, - cookie: { maxAge: 14 * 24 * 60 * 60 }, + cookie: { maxAge: 1209600000 }, // 2 weeks store: new MongoStore({ mongooseConnection: mongoose.connection, touchAfter: 24 * 3600, diff --git a/react-ui/src/components/root/MainMenu.js b/react-ui/src/components/root/MainMenu.js index 8128686f0..7d14a298e 100644 --- a/react-ui/src/components/root/MainMenu.js +++ b/react-ui/src/components/root/MainMenu.js @@ -8,7 +8,7 @@ import sink_logo from "../../assets/sink_logo.png" const dropdownStyle = { backgroundColor: "#fff", border: "1px solid #ddd", - boxShadow: "3px 3px 5px rgba(0, 0, 0, 0.2)" + boxShadow: "3px 3px 5px rgba(0, 0, 0, 0.2)", } const MainMenu = () => { @@ -16,7 +16,9 @@ const MainMenu = () => { const history = useHistory() const logInOrAva = () => { - if (loading || !data || !data.user || error) { + if (loading) return null + + if (!data || !data.user || error) { return ( @@ -32,14 +34,14 @@ const MainMenu = () => { key: "user", text: "User Page", icon: "user", - onClick: () => history.push(`/u/${user.discord_id}`) + onClick: () => history.push(`/u/${user.discord_id}`), }, { key: "sign-out", text: "Sign Out", icon: "sign out", - onClick: () => window.location.assign("/logout") - } + onClick: () => window.location.assign("/logout"), + }, ] const userMenuTrigger = (