File tree Expand file tree Collapse file tree
src/routes/(public)/recover Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 });
2424
2525 async function recover() {
26+ let showGenericSuccessNotification = true ;
2627 try {
2728 await sdk .forConsole .account .createRecovery ({
2829 email ,
2930 url: window .location .toString ()
3031 });
31- addNotification ({
32- type: ' success' ,
33- message: ' We have sent you an email with a password reset link'
34- });
3532 trackEvent (Submit .AccountRecover );
3633 } catch (error ) {
34+ // Do not show error for 403 Forbidden or 404 Not Found to prevent email enumeration
35+ if (error .code !== 403 && error .code !== 404 ) {
36+ showGenericSuccessNotification = false ;
37+ addNotification ({
38+ type: ' error' ,
39+ message: error .message
40+ });
41+ trackError (error , Submit .AccountRecover );
42+ }
43+ }
44+
45+ if (showGenericSuccessNotification ) {
3746 addNotification ({
38- type: ' error' ,
39- message: error .message
47+ type: ' success' ,
48+ message:
49+ ' If an account exists for this email, you will receive a password reset link shortly'
4050 });
41- trackError (error , Submit .AccountRecover );
4251 }
4352 }
4453
You can’t perform that action at this time.
0 commit comments