Compare commits
3 Commits
84cf2124ef
...
5977f9325f
Author | SHA1 | Date | |
---|---|---|---|
5977f9325f | |||
63d48d4de9 | |||
28eba4ebf0 |
@ -102,7 +102,7 @@
|
||||
|
||||
<a
|
||||
id="voxpeople"
|
||||
:href="'https://framaforms.org/quel-est-votre-avis-sur-happydns-1610366701?u=' + (user_isLogged?user_getSession.id:0) + '&p=' + $router.history.current.name + '&l=' + $i18n.locale"
|
||||
:href="'https://framaforms.org/quel-est-votre-avis-sur-happydns-1610366701?u=' + (user_isLogged?user_getSession.id:0) + '&i=' + instancename + '&p=' + $router.history.current.name + '&l=' + $i18n.locale"
|
||||
target="_blank"
|
||||
:title="$t('common.survey')"
|
||||
>
|
||||
@ -143,6 +143,9 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
instancename () {
|
||||
return window.location.hostname
|
||||
},
|
||||
...mapGetters('user', ['user_getSession', 'user_getSettings', 'user_isLogged'])
|
||||
},
|
||||
|
||||
|
@ -48,7 +48,7 @@ export default {
|
||||
domains.forEach(function (domain) {
|
||||
newDomainState &= domain.length >= 1 && domain.length <= 63
|
||||
newDomainState &= domain[0] !== '-' && domain[domain.length - 1] !== '-'
|
||||
newDomainState &= /^(\*|[a-zA-Z0-9]([a-zA-Z0-9-]?[a-zA-Z0-9])*)$/.test(domain)
|
||||
newDomainState &= /^(\*|_?[a-zA-Z0-9]([a-zA-Z0-9-]?[a-zA-Z0-9])*)$/.test(domain)
|
||||
})
|
||||
ret = newDomainState > 0
|
||||
}
|
||||
|
@ -102,7 +102,8 @@
|
||||
</b-col>
|
||||
</b-form-row>
|
||||
<b-form-row class="mt-3">
|
||||
<b-button class="offset-sm-4 col-sm-4" type="submit" variant="primary">
|
||||
<b-button class="offset-sm-4 col-sm-4" :disabled="formSent" type="submit" variant="primary">
|
||||
<b-spinner v-if="formSent" label="Spinning" small />
|
||||
{{ $t('password.redefine') }}
|
||||
</b-button>
|
||||
</b-form-row>
|
||||
@ -122,6 +123,7 @@ export default {
|
||||
return {
|
||||
email: '',
|
||||
emailState: null,
|
||||
formSent: false,
|
||||
error: null,
|
||||
signupForm: {
|
||||
password: '',
|
||||
@ -165,6 +167,7 @@ export default {
|
||||
this.emailState = valid
|
||||
|
||||
if (valid) {
|
||||
this.formSent = true
|
||||
axios
|
||||
.patch('/api/users', {
|
||||
kind: 'recovery',
|
||||
@ -172,6 +175,7 @@ export default {
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
this.formSent = false
|
||||
this.$root.$bvToast.toast(
|
||||
this.$t('email.instruction.check-inbox'), {
|
||||
title: this.$t('email.sent-recovery'),
|
||||
@ -183,6 +187,7 @@ export default {
|
||||
this.$router.push('/login')
|
||||
},
|
||||
(error) => {
|
||||
this.formSent = false
|
||||
this.$bvToast.toast(
|
||||
error.response.data.errmsg, {
|
||||
title: this.$t('errors.recovery'),
|
||||
@ -199,6 +204,7 @@ export default {
|
||||
const valid = this.$refs.formRecover.checkValidity()
|
||||
|
||||
if (valid && this.user) {
|
||||
this.formSent = true
|
||||
axios
|
||||
.post('/api/users/' + encodeURIComponent(this.user) + '/recovery', {
|
||||
key: this.$route.query.k,
|
||||
@ -206,6 +212,7 @@ export default {
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
this.formSent = false
|
||||
this.$root.$bvToast.toast(
|
||||
this.$t('password.success'), {
|
||||
title: this.$t('password.redefined'),
|
||||
@ -217,6 +224,7 @@ export default {
|
||||
this.$router.push('/login')
|
||||
},
|
||||
(error) => {
|
||||
this.formSent = false
|
||||
this.$bvToast.toast(
|
||||
error.response.data.errmsg, {
|
||||
title: this.$t('errors.recovery'),
|
||||
|
@ -86,7 +86,8 @@
|
||||
/>
|
||||
</b-form-group>
|
||||
<div class="d-flex justify-content-around">
|
||||
<b-button type="submit" variant="primary">
|
||||
<b-button :disabled="formSent" type="submit" variant="primary">
|
||||
<b-spinner v-if="formSent" label="Spinning" small />
|
||||
{{ $t('common.go') }}
|
||||
</b-button>
|
||||
<b-button to="/forgotten-password" variant="outline-dark">
|
||||
@ -107,6 +108,7 @@ export default {
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
formSent: false,
|
||||
loginForm: {}
|
||||
}
|
||||
},
|
||||
@ -127,12 +129,15 @@ export default {
|
||||
this.loginForm.emailState = valid ? 'valid' : 'invalid'
|
||||
this.loginForm.passwordState = valid ? 'valid' : 'invalid'
|
||||
if (valid) {
|
||||
this.formSent = true
|
||||
this.$store.dispatch('user/login', this.loginForm)
|
||||
.then(
|
||||
(response) => {
|
||||
this.formSent = false
|
||||
this.$router.push('/')
|
||||
},
|
||||
(error) => {
|
||||
this.formSent = false
|
||||
this.$bvToast.toast(
|
||||
error.response.data.errmsg, {
|
||||
title: this.$t('errors.login'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user