|
|
@@ -139,7 +139,7 @@ async function injectNextI18NextConfigurations(context: GetServerSidePropsContex
|
|
|
|
|
|
export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
|
|
|
const req = context.req as CrowiRequest<IUserHasId & any>;
|
|
|
- const { user } = req;
|
|
|
+ const { user, crowi } = req;
|
|
|
|
|
|
const result = await getServerSideCommonProps(context);
|
|
|
|
|
|
@@ -153,7 +153,9 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
|
|
|
const props: Props = result.props as Props;
|
|
|
|
|
|
if (user != null) {
|
|
|
- props.currentUser = user.toObject();
|
|
|
+ const User = crowi.model('User');
|
|
|
+ const userData = await User.findById(req.user.id).populate({ path: 'imageAttachment', select: 'filePathProxied' });
|
|
|
+ props.currentUser = userData.toObject();
|
|
|
}
|
|
|
|
|
|
await injectUserUISettings(context, props);
|