1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-25 00:46:46 +00:00
bramw_baserow/web-frontend/modules/core/mixins/resendEmailVerification.js
2024-04-25 08:34:01 +00:00

38 lines
876 B
JavaScript

import AuthService from '@baserow/modules/core/services/auth'
import { notifyIf } from '@baserow/modules/core/utils/error'
export default {
data() {
return {
resendLoading: false,
resendSuccess: false,
}
},
methods: {
async resend(email) {
if (this.resendLoading) {
return
}
this.resendLoading = true
try {
await AuthService(this.$client).sendVerifyEmail(email)
this.resendSuccess = true
this.$store.dispatch('toast/info', {
title: this.$i18n.t(
'resendEmailVerification.confirmationEmailSentTitle'
),
message: this.$i18n.t(
'resendEmailVerification.confirmationEmailSentDescription'
),
})
} catch (error) {
notifyIf(error, 'emailVerification')
}
this.resendLoading = false
},
},
}