diff --git a/CommonUI/src/Components/Forms/ModelForm.tsx b/CommonUI/src/Components/Forms/ModelForm.tsx index 1a69e1a0ca..a84c9f4174 100644 --- a/CommonUI/src/Components/Forms/ModelForm.tsx +++ b/CommonUI/src/Components/Forms/ModelForm.tsx @@ -118,7 +118,7 @@ const ModelForm: ( ? (Object.keys(field.field)[0] as string) : null; - if (key && hasPermissionOnField(key)) { + if (key && (hasPermissionOnField(key) || field.forceShow)) { (select as Dictionary)[key] = true; } } diff --git a/Identity/API/StatusPageAuthentication.ts b/Identity/API/StatusPageAuthentication.ts index 653750b1ed..6033ac8d7e 100644 --- a/Identity/API/StatusPageAuthentication.ts +++ b/Identity/API/StatusPageAuthentication.ts @@ -38,6 +38,10 @@ router.post( try { const data: JSONObject = req.body['data']; + if (!data['email']) { + throw new BadDataException('Email is required.'); + } + const user: StatusPagePrivateUser = JSONFunctions.fromJSON( data as JSONObject, StatusPagePrivateUser @@ -164,7 +168,13 @@ router.post( next: NextFunction ): Promise => { try { - const data: JSONObject = req.body['data']; + const data: JSONObject = JSONFunctions.deserialize( + req.body['data'] + ); + + if (!data['statusPageId']) { + throw new BadDataException('Status Page ID is required.'); + } const user: StatusPagePrivateUser = JSONFunctions.fromJSON( data as JSONObject, @@ -207,7 +217,7 @@ router.post( const statusPage: StatusPage | null = await StatusPageService.findOneById({ - id: new ObjectID(data['statusPageId'] as string), + id: new ObjectID(data['statusPageId'].toString()), props: { isRoot: true, ignoreHooks: true, diff --git a/StatusPage/src/Pages/Accounts/ResetPassword.tsx b/StatusPage/src/Pages/Accounts/ResetPassword.tsx index 643a15364a..e80ce9da0b 100644 --- a/StatusPage/src/Pages/Accounts/ResetPassword.tsx +++ b/StatusPage/src/Pages/Accounts/ResetPassword.tsx @@ -110,6 +110,9 @@ const ResetPassword: FunctionComponent = ( ?.toString() .replace('/', '') .toString() || ''; + + item.statusPageId = + StatusPageUtil.getStatusPageId()!; return Promise.resolve(item); }} showAsColumns={1}