|
|
@ -10,7 +10,7 @@
|
|
|
|
offset-lg3, lg6
|
|
|
|
offset-lg3, lg6
|
|
|
|
offset-xl4, xl4
|
|
|
|
offset-xl4, xl4
|
|
|
|
)
|
|
|
|
)
|
|
|
|
transition(name='zoom')
|
|
|
|
transition(name='fadeUp')
|
|
|
|
v-card.elevation-5.md2(v-show='isShown')
|
|
|
|
v-card.elevation-5.md2(v-show='isShown')
|
|
|
|
v-toolbar(color='indigo', flat, dense, dark)
|
|
|
|
v-toolbar(color='indigo', flat, dense, dark)
|
|
|
|
v-spacer
|
|
|
|
v-spacer
|
|
|
@ -43,6 +43,7 @@
|
|
|
|
:placeholder='$t("auth:fields.password")'
|
|
|
|
:placeholder='$t("auth:fields.password")'
|
|
|
|
color='indigo'
|
|
|
|
color='indigo'
|
|
|
|
loading
|
|
|
|
loading
|
|
|
|
|
|
|
|
counter='255'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
password-strength(slot='progress', v-model='password')
|
|
|
|
password-strength(slot='progress', v-model='password')
|
|
|
|
v-text-field.md2.mt-2(
|
|
|
|
v-text-field.md2.mt-2(
|
|
|
@ -63,12 +64,12 @@
|
|
|
|
flat
|
|
|
|
flat
|
|
|
|
prepend-icon='person'
|
|
|
|
prepend-icon='person'
|
|
|
|
background-color='grey lighten-4'
|
|
|
|
background-color='grey lighten-4'
|
|
|
|
hide-details
|
|
|
|
|
|
|
|
ref='iptName'
|
|
|
|
ref='iptName'
|
|
|
|
v-model='name'
|
|
|
|
v-model='name'
|
|
|
|
:placeholder='$t("auth:fields.name")'
|
|
|
|
:placeholder='$t("auth:fields.name")'
|
|
|
|
@keyup.enter='register'
|
|
|
|
@keyup.enter='register'
|
|
|
|
color='indigo'
|
|
|
|
color='indigo'
|
|
|
|
|
|
|
|
counter='255'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
v-card-actions.pb-4
|
|
|
|
v-card-actions.pb-4
|
|
|
|
v-spacer
|
|
|
|
v-spacer
|
|
|
@ -116,7 +117,9 @@ export default {
|
|
|
|
name: '',
|
|
|
|
name: '',
|
|
|
|
hidePassword: true,
|
|
|
|
hidePassword: true,
|
|
|
|
isLoading: false,
|
|
|
|
isLoading: false,
|
|
|
|
isShown: false
|
|
|
|
isShown: false,
|
|
|
|
|
|
|
|
loaderColor: 'grey darken-4',
|
|
|
|
|
|
|
|
loaderTitle: 'Working...'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
@ -211,6 +214,8 @@ export default {
|
|
|
|
this.$refs.iptName.focus()
|
|
|
|
this.$refs.iptName.focus()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.loaderColor = 'grey darken-4'
|
|
|
|
|
|
|
|
this.loaderTitle = this.$t('auth:registering')
|
|
|
|
this.isLoading = true
|
|
|
|
this.isLoading = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
let resp = await this.$apollo.mutate({
|
|
|
|
let resp = await this.$apollo.mutate({
|
|
|
@ -224,11 +229,8 @@ export default {
|
|
|
|
if (_.has(resp, 'data.authentication.register')) {
|
|
|
|
if (_.has(resp, 'data.authentication.register')) {
|
|
|
|
let respObj = _.get(resp, 'data.authentication.register', {})
|
|
|
|
let respObj = _.get(resp, 'data.authentication.register', {})
|
|
|
|
if (respObj.responseResult.succeeded === true) {
|
|
|
|
if (respObj.responseResult.succeeded === true) {
|
|
|
|
this.$store.commit('showNotification', {
|
|
|
|
this.loaderColor = 'green'
|
|
|
|
message: 'Account created successfully! Redirecting...',
|
|
|
|
this.loaderTitle = this.$t('auth:registerSuccess')
|
|
|
|
style: 'success',
|
|
|
|
|
|
|
|
icon: 'check'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
Cookies.set('jwt', respObj.jwt, { expires: 365 })
|
|
|
|
Cookies.set('jwt', respObj.jwt, { expires: 365 })
|
|
|
|
_.delay(() => {
|
|
|
|
_.delay(() => {
|
|
|
|
window.location.replace('/')
|
|
|
|
window.location.replace('/')
|
|
|
@ -237,7 +239,7 @@ export default {
|
|
|
|
throw new Error(respObj.responseResult.message)
|
|
|
|
throw new Error(respObj.responseResult.message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw new Error('Registration is unavailable at this time.')
|
|
|
|
throw new Error(this.$t('auth:genericError'))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err)
|
|
|
|
console.error(err)
|
|
|
|