@@ -21,16 +21,16 @@ import NcPasswordField from '@nextcloud/vue/components/NcPasswordField'
2121const publicShareAuth = loadState <{
2222 canResendPassword: boolean
2323 shareType: ShareType
24- identityOk ? : boolean | null
24+ showPasswordReset ? : boolean
2525 invalidPassword? : boolean
2626}>(' core' , ' publicShareAuth' )
2727
2828const requestToken = getRequestToken ()
2929const sharingToken = getSharingToken ()
3030const { shareType, invalidPassword, canResendPassword } = publicShareAuth
3131
32- const hasIdentityCheck = typeof publicShareAuth .identityOk === ' boolean '
33- const showIdentityCheck = ref (typeof publicShareAuth .identityOk === ' boolean ' )
32+ const isPasswordResetProcessed = !! publicShareAuth .showPasswordReset
33+ const showPasswordReset = ref (publicShareAuth .showPasswordReset ?? false )
3434const password = ref (' ' )
3535const email = ref (' ' )
3636
@@ -48,7 +48,7 @@ onMounted(() => {
4848 <NcGuestContent :class =" $style.publicShareAuth" >
4949 <h2 >{{ t('core', 'This share is password-protected') }}</h2 >
5050 <form
51- v-show =" !showIdentityCheck "
51+ v-show =" !showPasswordReset "
5252 :class =" $style.publicShareAuth__form"
5353 method =" POST" >
5454 <NcNoteCard v-if =" invalidPassword" type =" error" >
@@ -74,15 +74,14 @@ onMounted(() => {
7474 </form >
7575
7676 <form
77- v-if =" showIdentityCheck "
77+ v-if =" showPasswordReset "
7878 :class =" $style.publicShareAuth__form"
7979 method =" POST" >
80- <NcNoteCard v-if =" !hasIdentityCheck" type =" info" >
81- {{ t('core', 'Please type in your email address to request a temporary password') }}
82- </NcNoteCard >
83-
84- <NcNoteCard v-else :type =" publicShareAuth.identityOk ? 'success' : 'error'" >
85- {{ publicShareAuth.identityOk ? t('core', 'Password sent!') : t('core', 'You are not authorized to request a password for this share') }}
80+ <NcNoteCard type =" info" >
81+ {{ isPasswordResetProcessed
82+ ? t('core', 'If the email address was correct then you will receive an email with the password.')
83+ : t('core', 'Please type in your email address to request a temporary password')
84+ }}
8685 </NcNoteCard >
8786
8887 <NcTextField
@@ -96,7 +95,7 @@ onMounted(() => {
9695 <input type =" hidden" name =" passwordRequest" value =" " >
9796
9897 <NcFormBox row >
99- <NcButton wide @click =" showIdentityCheck = false" >
98+ <NcButton wide @click =" showPasswordReset = false" >
10099 {{ t('core', 'Back') }}
101100 </NcButton >
102101 <NcButton type =" submit" variant =" primary" wide >
@@ -107,10 +106,10 @@ onMounted(() => {
107106
108107 <!-- request password button -->
109108 <NcButton
110- v-if =" canResendPassword && !showIdentityCheck "
109+ v-if =" canResendPassword && !showPasswordReset "
111110 :class =" $style.publicShareAuth__forgotPasswordButton"
112111 wide
113- @click =" showIdentityCheck = true" >
112+ @click =" showPasswordReset = true" >
114113 {{ t('core', 'Forgot password') }}
115114 </NcButton >
116115 </NcGuestContent >
0 commit comments