Browse Source

fix(gui-v2): prevent having to submit twice

pull/2744/head
braks 2 years ago
parent
commit
65cc4c8355
  1. 7
      packages/nc-gui-v2/pages/forgot-password.vue
  2. 8
      packages/nc-gui-v2/pages/signin.vue
  3. 7
      packages/nc-gui-v2/pages/signup.vue

7
packages/nc-gui-v2/pages/forgot-password.vue

@ -20,8 +20,6 @@ definePageMeta({
let error = $ref<string | null>(null)
let success = $ref(false)
const valid = $ref()
const formValidator = ref()
const form = reactive({
@ -46,6 +44,7 @@ const formRules = {
}
const resetPassword = async () => {
const valid = formValidator.value.validate()
if (!valid) return
error = null
@ -72,9 +71,7 @@ const resetError = () => {
layout="vertical"
:model="form"
class="forgot-password h-full min-h-[600px] flex justify-center items-center"
@finish="valid = true"
@finish-failed="valid = false"
@submit.prevent="resetPassword"
@finish="resetPassword"
>
<div class="h-full w-full flex flex-col flex-wrap justify-center items-center">
<div

8
packages/nc-gui-v2/pages/signin.vue

@ -16,8 +16,9 @@ definePageMeta({
title: 'title.headLogin',
})
const formValidator = ref()
let error = $ref<string | null>(null)
const valid = $ref(false)
const form = reactive({
email: '',
@ -46,6 +47,7 @@ const formRules = {
}
const signIn = async () => {
const valid = formValidator.value.validate()
if (!valid) return
error = null
@ -73,9 +75,7 @@ const resetError = () => {
:model="form"
layout="vertical"
class="signin h-[calc(100%_+_90px)] min-h-[600px] flex justify-center items-center"
@finish="valid = true"
@finish-failed="valid = false"
@submit.prevent="signIn"
@finish="signIn"
>
<div class="h-full w-full flex flex-col flex-wrap justify-center items-center">
<div

7
packages/nc-gui-v2/pages/signup.vue

@ -14,7 +14,7 @@ definePageMeta({
requiresAuth: false,
})
const valid = $ref()
const formValidator = ref()
let error = $ref<string | null>(null)
const form = reactive({
@ -60,6 +60,7 @@ const formRules = {
}
const signUp = async () => {
const valid = formValidator.value.validate()
if (!valid) return
error = null
@ -86,9 +87,7 @@ const resetError = () => {
:model="form"
layout="vertical"
class="signup h-[calc(100%_+_90px)] min-h-[600px] flex justify-center items-center"
@finish="valid = true"
@finish-failed="valid = false"
@submit.prevent="signUp"
@finish="signUp"
>
<div class="h-full w-full flex flex-col flex-wrap justify-center items-center">
<div

Loading…
Cancel
Save