mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #59545 from nextcloud/backport/59289/stable33
This commit is contained in:
commit
032afb120e
4 changed files with 19 additions and 18 deletions
|
|
@ -21,7 +21,7 @@ import NcPasswordField from '@nextcloud/vue/components/NcPasswordField'
|
|||
const publicShareAuth = loadState<{
|
||||
canResendPassword: boolean
|
||||
shareType: ShareType
|
||||
identityOk?: boolean | null
|
||||
showPasswordReset?: boolean
|
||||
invalidPassword?: boolean
|
||||
}>('core', 'publicShareAuth')
|
||||
|
||||
|
|
@ -29,8 +29,8 @@ const requestToken = getRequestToken()
|
|||
const sharingToken = getSharingToken()
|
||||
const { shareType, invalidPassword, canResendPassword } = publicShareAuth
|
||||
|
||||
const hasIdentityCheck = typeof publicShareAuth.identityOk === 'boolean'
|
||||
const showIdentityCheck = ref(typeof publicShareAuth.identityOk === 'boolean')
|
||||
const isPasswordResetProcessed = !!publicShareAuth.showPasswordReset
|
||||
const showPasswordReset = ref(publicShareAuth.showPasswordReset ?? false)
|
||||
const password = ref('')
|
||||
const email = ref('')
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ onMounted(() => {
|
|||
<NcGuestContent :class="$style.publicShareAuth">
|
||||
<h2>{{ t('core', 'This share is password-protected') }}</h2>
|
||||
<form
|
||||
v-show="!showIdentityCheck"
|
||||
v-show="!showPasswordReset"
|
||||
:class="$style.publicShareAuth__form"
|
||||
method="POST">
|
||||
<NcNoteCard v-if="invalidPassword" type="error">
|
||||
|
|
@ -74,15 +74,14 @@ onMounted(() => {
|
|||
</form>
|
||||
|
||||
<form
|
||||
v-if="showIdentityCheck"
|
||||
v-if="showPasswordReset"
|
||||
:class="$style.publicShareAuth__form"
|
||||
method="POST">
|
||||
<NcNoteCard v-if="!hasIdentityCheck" type="info">
|
||||
{{ t('core', 'Please type in your email address to request a temporary password') }}
|
||||
</NcNoteCard>
|
||||
|
||||
<NcNoteCard v-else :type="publicShareAuth.identityOk ? 'success' : 'error'">
|
||||
{{ publicShareAuth.identityOk ? t('core', 'Password sent!') : t('core', 'You are not authorized to request a password for this share') }}
|
||||
<NcNoteCard type="info">
|
||||
{{ isPasswordResetProcessed
|
||||
? t('core', 'If the email address was correct then you will receive an email with the password.')
|
||||
: t('core', 'Please type in your email address to request a temporary password')
|
||||
}}
|
||||
</NcNoteCard>
|
||||
|
||||
<NcTextField
|
||||
|
|
@ -96,7 +95,7 @@ onMounted(() => {
|
|||
<input type="hidden" name="passwordRequest" value="">
|
||||
|
||||
<NcFormBox row>
|
||||
<NcButton wide @click="showIdentityCheck = false">
|
||||
<NcButton wide @click="showPasswordReset = false">
|
||||
{{ t('core', 'Back') }}
|
||||
</NcButton>
|
||||
<NcButton type="submit" variant="primary" wide>
|
||||
|
|
@ -107,10 +106,10 @@ onMounted(() => {
|
|||
|
||||
<!-- request password button -->
|
||||
<NcButton
|
||||
v-if="canResendPassword && !showIdentityCheck"
|
||||
v-if="canResendPassword && !showPasswordReset"
|
||||
:class="$style.publicShareAuth__forgotPasswordButton"
|
||||
wide
|
||||
@click="showIdentityCheck = true">
|
||||
@click="showPasswordReset = true">
|
||||
{{ t('core', 'Forgot password') }}
|
||||
</NcButton>
|
||||
</NcGuestContent>
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@
|
|||
\OCP\Util::addStyle('core', 'guest');
|
||||
\OCP\Util::addScript('core', 'public_share_auth');
|
||||
|
||||
$showPasswordReset = isset($_['identityOk']) && $_['identityOk'] !== null;
|
||||
$initialState = \OCP\Server::get(\OCP\IInitialStateService::class);
|
||||
$initialState->provideInitialState('files_sharing', 'sharingToken', $_['share']->getToken());
|
||||
$initialState->provideInitialState('core', 'publicShareAuth', [
|
||||
'identityOk' => $_['identityOk'] ?? null,
|
||||
// if the password reset was processed (not caring about result)
|
||||
'showPasswordReset' => $showPasswordReset,
|
||||
'shareType' => $_['share']->getShareType(),
|
||||
'invalidPassword' => $_['wrongpw'] ?? null,
|
||||
'canResendPassword' => $_['share']->getShareType() === \OCP\Share\IShare::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk(),
|
||||
|
|
|
|||
4
dist/core-public_share_auth.js
vendored
4
dist/core-public_share_auth.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-public_share_auth.js.map
vendored
2
dist/core-public_share_auth.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue