Continued creating the entity system
This commit is contained in:
@@ -37,14 +37,7 @@ import {getUserCorporate} from "@/utils/groups.be";
|
||||
import {getUsers} from "@/utils/users.be";
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(async ({req, res}) => {
|
||||
const user = req.session.user;
|
||||
|
||||
const envVariables: {[key: string]: string} = {};
|
||||
Object.keys(process.env)
|
||||
.filter((x) => x.startsWith("NEXT_PUBLIC"))
|
||||
.forEach((x: string) => {
|
||||
envVariables[x] = process.env[x]!;
|
||||
});
|
||||
const user = req.session.user as User | undefined;
|
||||
|
||||
if (!user) {
|
||||
return {
|
||||
@@ -58,13 +51,12 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res}) => {
|
||||
const linkedCorporate = (await getUserCorporate(user.id)) || null;
|
||||
|
||||
return {
|
||||
props: {user, envVariables, linkedCorporate},
|
||||
props: {user, linkedCorporate},
|
||||
};
|
||||
}, sessionOptions);
|
||||
|
||||
interface Props {
|
||||
user: User;
|
||||
envVariables: {[key: string]: string};
|
||||
linkedCorporate?: CorporateUser | MasterCorporateUser;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user