mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 03:10:51 +00:00
Merge remote-tracking branch 'origin/email-verification'
# Conflicts: # composer.lock # public/mix-manifest.json # tests/TestCase.php
This commit is contained in:
@@ -58,6 +58,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<div class="input-wrapper">
|
||||
<div class="inline-wrapper">
|
||||
<div class="switch-label">
|
||||
<label class="input-label">
|
||||
{{ $t('admin_settings.others.allow_user_verification') }}:
|
||||
</label>
|
||||
<small class="input-help" v-html="$t('admin_settings.others.allow_user_verification_help')"></small>
|
||||
</div>
|
||||
<SwitchInput @input="$updateText('/admin/settings', 'user_verification', app.userVerification)"
|
||||
v-model="app.userVerification"
|
||||
class="switch"
|
||||
:state="app.userVerification"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FormLabel class="mt-70">
|
||||
{{ $t('admin_settings.others.section_others') }}
|
||||
</FormLabel>
|
||||
@@ -173,7 +191,7 @@
|
||||
mounted() {
|
||||
axios.get('/api/admin/settings', {
|
||||
params: {
|
||||
column: 'contact_email|google_analytics|storage_default|registration|storage_limitation|mimetypes_blacklist|upload_limit'
|
||||
column: 'contact_email|google_analytics|storage_default|registration|storage_limitation|mimetypes_blacklist|upload_limit|user_verification'
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
@@ -186,7 +204,8 @@
|
||||
userRegistration: parseInt(response.data.registration),
|
||||
storageLimitation: parseInt(response.data.storage_limitation),
|
||||
mimetypesBlacklist : response.data.mimetypes_blacklist,
|
||||
uploadLimit: response.data.upload_limit
|
||||
uploadLimit: response.data.upload_limit,
|
||||
userVerification: parseInt(response.data.user_verification)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -61,6 +61,19 @@
|
||||
</router-link>
|
||||
</span>
|
||||
</AuthContent>
|
||||
|
||||
<AuthContent name="not-verified" :visible="false">
|
||||
|
||||
<div class="user" v-if="checkedAccount">
|
||||
<img class="user-avatar" :src="checkedAccount.avatar" :alt="checkedAccount.name">
|
||||
<h1>{{ checkedAccount.name }}</h1>
|
||||
<h2>{{ $t('page_not_verified.subtitle') }}</h2>
|
||||
</div>
|
||||
|
||||
<span class="additional-link"> {{ $t('page_not_verified.resend_text') }}
|
||||
<a @click="resendEmail" class="text-theme">{{ $t('page_not_verified.resend_button') }} </a>
|
||||
</span>
|
||||
</AuthContent>
|
||||
</AuthContentWrapper>
|
||||
</template>
|
||||
|
||||
@@ -110,6 +123,18 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
resendEmail() {
|
||||
axios.
|
||||
post('/api/user/email/resend/verify', {
|
||||
email: this.loginEmail
|
||||
})
|
||||
.then(
|
||||
this.$router.push({name: 'SuccessfullySend'})
|
||||
)
|
||||
.catch(() => {
|
||||
this.$isSomethingWrong()
|
||||
})
|
||||
},
|
||||
async logIn() {
|
||||
|
||||
// Validate fields
|
||||
@@ -164,6 +189,13 @@
|
||||
|
||||
if (!isValid) return;
|
||||
|
||||
if(!this.checkedAccount.verified) {
|
||||
|
||||
this.goToAuthPage('not-verified')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Start loading
|
||||
this.isLoading = true
|
||||
|
||||
|
||||
@@ -132,17 +132,23 @@
|
||||
|
||||
// Send request to get user token
|
||||
axios
|
||||
.post('/register', this.register)
|
||||
.post('/api/register', this.register)
|
||||
.then(() => {
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
|
||||
// Set login state
|
||||
this.$store.commit('SET_AUTHORIZED', true)
|
||||
|
||||
// Go to files page
|
||||
this.$router.push({name: 'Files'})
|
||||
if(! this.config.userVerification) {
|
||||
// Set login state
|
||||
this.$store.commit('SET_AUTHORIZED', true)
|
||||
|
||||
// Go to files page
|
||||
this.$router.push({name: 'Files'})
|
||||
} else {
|
||||
// Go to SuccessfullySend page
|
||||
this.$router.push({name: 'SuccessfullySend'})
|
||||
}
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<AuthContentWrapper>
|
||||
<AuthContent :visible="true">
|
||||
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
|
||||
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
|
||||
|
||||
<h1>{{ $t('page_email_successfully_verified.title') }}</h1>
|
||||
<h2>{{ $t('page_email_successfully_verified.subtitle') }}</h2>
|
||||
|
||||
<a href="/sign-in">
|
||||
<AuthButton icon="chevron-right" :text="$t('page_sign_in.button_log_in')"/>
|
||||
</a>
|
||||
|
||||
</AuthContent>
|
||||
</AuthContentWrapper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'SuccessfullyEmailVerified',
|
||||
components: {
|
||||
AuthContentWrapper,
|
||||
AuthContent,
|
||||
AuthButton,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['config']),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@assets/vuefilemanager/_auth-form';
|
||||
@import '@assets/vuefilemanager/_auth';
|
||||
</style>
|
||||
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<AuthContentWrapper>
|
||||
<AuthContent :visible="true">
|
||||
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
|
||||
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
|
||||
|
||||
<h1>{{ $t('page_email_successfully_send.title') }}</h1>
|
||||
<h2>{{ $t('page_email_successfully_send.subtitle') }}</h2>
|
||||
|
||||
<span class="additional-link">
|
||||
<router-link :to="{name: 'Homepage'}" class="text-theme">
|
||||
{{ $t('go_home') }}
|
||||
</router-link>
|
||||
</span>
|
||||
|
||||
</AuthContent>
|
||||
</AuthContentWrapper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'SuccessfullySendEmail',
|
||||
components: {
|
||||
AuthContentWrapper,
|
||||
AuthContent,
|
||||
AuthButton,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['config']),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@assets/vuefilemanager/_auth-form';
|
||||
@import '@assets/vuefilemanager/_auth';
|
||||
</style>
|
||||
@@ -32,6 +32,15 @@
|
||||
{{ $t('menu.password') }}
|
||||
</div>
|
||||
</router-link>
|
||||
|
||||
<router-link replace :to="{name: 'Token'}" class="menu-list-item link">
|
||||
<div class="icon text-theme">
|
||||
<key-icon size="17"></key-icon>
|
||||
</div>
|
||||
<div class="label text-theme">
|
||||
{{ $t('menu.token') }}
|
||||
</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</ContentGroup>
|
||||
<ContentGroup title="Subscription" class="navigator" v-if="canShowSubscriptionSettings">
|
||||
@@ -142,6 +151,7 @@
|
||||
CloudIcon,
|
||||
UserIcon,
|
||||
LockIcon,
|
||||
KeyIcon,
|
||||
} from 'vue-feather-icons'
|
||||
|
||||
export default {
|
||||
@@ -162,6 +172,7 @@
|
||||
LockIcon,
|
||||
Spinner,
|
||||
InfoBox,
|
||||
KeyIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['user', 'config']),
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<PageTab>
|
||||
<PageTabGroup>
|
||||
<FormLabel>{{ $t('user_token.title') }}</FormLabel>
|
||||
</PageTabGroup>
|
||||
</PageTab>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageTabGroup from '@/components/Others/Layout/PageTabGroup'
|
||||
import FormLabel from '@/components/Others/Forms/FormLabel'
|
||||
import PageTab from '@/components/Others/Layout/PageTab'
|
||||
|
||||
export default {
|
||||
name: 'AccessToken',
|
||||
components: {
|
||||
PageTabGroup,
|
||||
FormLabel,
|
||||
PageTab
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
tokens: undefined
|
||||
}
|
||||
},
|
||||
created () {
|
||||
axios.
|
||||
get('/api/user/tokens')
|
||||
.then(response => {
|
||||
this.tokens = response.data
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@assets/vuefilemanager/_variables';
|
||||
@import '@assets/vuefilemanager/_mixins';
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user