From 40520c6718cbc41ac10b9aa6510f007e67c0cad1 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 23 Mar 2022 16:11:19 +0100 Subject: [PATCH] regexp to check for error message --- frontend/src/pages/ResetPassword.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/ResetPassword.vue b/frontend/src/pages/ResetPassword.vue index 7532953ed..bf8664cef 100644 --- a/frontend/src/pages/ResetPassword.vue +++ b/frontend/src/pages/ResetPassword.vue @@ -104,7 +104,11 @@ export default { }) .catch((error) => { this.toastError(error.message) - if (error.message.includes('Code is older than 10 minutes')) + if ( + error.message.match( + /email was sent more than ([0-9]+ hours)?( and)?([0-9]+ minutes)? ago/, + ) + ) this.$router.push('/forgot-password/resetPassword') }) },