@@ -233,6 +233,8 @@ const user = ref('');
233233const password = ref (' ' );
234234const passwordConfirm = ref (' ' );
235235const token = ref (' ' );
236+ const tokenRequested = ref (false );
237+ const passwordResetRequested = ref (false );
236238
237239const smallScreen = computed (() => {
238240 return $q .screen .lt .sm ;
@@ -266,7 +268,7 @@ const username = computed(() => {
266268});
267269
268270const requestTokenDisabled = computed (() => {
269- return stringIsEmpty (user .value );
271+ return stringIsEmpty (user .value ) || tokenRequested . value ;
270272});
271273
272274const resetPasswordDisabled = computed (() => {
@@ -275,7 +277,8 @@ const resetPasswordDisabled = computed(() => {
275277 stringIsEmpty (token .value ) ||
276278 stringIsEmpty (password .value ) ||
277279 stringIsEmpty (passwordConfirm .value ) ||
278- password .value !== passwordConfirm .value
280+ password .value !== passwordConfirm .value ||
281+ passwordResetRequested .value
279282 );
280283});
281284
@@ -314,13 +317,16 @@ const clearLoginData = () => {
314317 password .value = ' ' ;
315318 passwordConfirm .value = ' ' ;
316319 token .value = ' ' ;
320+ tokenRequested .value = false ;
321+ passwordResetRequested .value = false ;
317322};
318323
319324const requestToken = () => {
320325 if (! user .value || user .value .length === 0 ) {
321326 console .error (' Benutzername erforderlich.' );
322327 return ;
323328 }
329+ tokenRequested .value = true ;
324330 mqttStore .sendSystemCommand (' createPasswordResetToken' , {
325331 username: user .value ,
326332 });
@@ -357,6 +363,7 @@ const resetPassword = () => {
357363 });
358364 return ;
359365 }
366+ passwordResetRequested .value = true ;
360367 mqttStore .sendSystemCommand (' resetUserPassword' , {
361368 username: user .value ,
362369 token: token .value ,
0 commit comments