@@ -37,6 +37,12 @@ const safeUrlField = z
3737 message : "Only http:// and https:// URLs are allowed" ,
3838 } ) ;
3939
40+ const safeEmailField = z
41+ . string ( )
42+ . refine ( ( val ) => val === "" || / ^ [ ^ \s @ ] + @ [ ^ \s @ ] + \. [ ^ \s @ ] + $ / . test ( val ) , {
43+ message : "Enter a valid email address" ,
44+ } ) ;
45+
4046const formSchema = z
4147 . object ( {
4248 appName : z . string ( ) ,
@@ -51,6 +57,8 @@ const formSchema = z
5157 errorPageDescription : z . string ( ) ,
5258 footerText : z . string ( ) ,
5359 ogImageUrl : safeUrlField ,
60+ passwordResetGuide : z . string ( ) . optional ( ) ,
61+ supportEmail : safeEmailField . optional ( ) ,
5462 logoLightUrl : z . string ( ) ,
5563 loginLogoLightUrl : z . string ( ) ,
5664 faviconLightUrl : z . string ( ) ,
@@ -218,6 +226,8 @@ export function WhitelabelingSettings() {
218226 errorPageDescription : "" ,
219227 footerText : "" ,
220228 ogImageUrl : "" ,
229+ passwordResetGuide : "" ,
230+ supportEmail : "" ,
221231 logoLightUrl : "" ,
222232 loginLogoLightUrl : "" ,
223233 faviconLightUrl : "" ,
@@ -241,6 +251,8 @@ export function WhitelabelingSettings() {
241251 errorPageDescription : data . errorPageDescription ?? "" ,
242252 footerText : data . footerText ?? "" ,
243253 ogImageUrl : data . ogImageUrl ?? "" ,
254+ passwordResetGuide : data . passwordResetGuide ?? "" ,
255+ supportEmail : data . supportEmail ?? "" ,
244256 logoLightUrl : data . logoLightUrl ?? "" ,
245257 loginLogoLightUrl : data . loginLogoLightUrl ?? "" ,
246258 faviconLightUrl : data . faviconLightUrl ?? "" ,
@@ -275,6 +287,8 @@ export function WhitelabelingSettings() {
275287 errorPageDescription : values . errorPageDescription || null ,
276288 footerText : values . footerText || null ,
277289 ogImageUrl : values . ogImageUrl || null ,
290+ passwordResetGuide : values . passwordResetGuide || null ,
291+ supportEmail : values . supportEmail || null ,
278292 logoLightUrl : values . logoLightUrl || null ,
279293 loginLogoLightUrl : values . loginLogoLightUrl || null ,
280294 faviconLightUrl : values . faviconLightUrl || null ,
0 commit comments