Merge remote-tracking branch 'origin/email-verification'

# Conflicts:
#	composer.lock
#	public/mix-manifest.json
#	tests/TestCase.php
This commit is contained in:
Peter Papp
2021-07-15 14:00:43 +02:00
43 changed files with 988 additions and 12292 deletions
@@ -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)
}
})
}
+32
View File
@@ -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
+12 -6
View File
@@ -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>
+11
View File
@@ -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']),
+41
View File
@@ -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>