chore: Adjust Chatwoot Config to deploy frontend as a separate app (#2347)
This commit is contained in:
@@ -2,31 +2,35 @@
|
||||
<loading-state :message="$t('CONFIRM_EMAIL')"></loading-state>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
import LoadingState from '../../components/widgets/LoadingState';
|
||||
import Auth from '../../api/auth';
|
||||
import { DEFAULT_REDIRECT_URL } from '../../constants';
|
||||
export default {
|
||||
props: {
|
||||
confirmationToken: String,
|
||||
redirectUrl: String,
|
||||
config: String,
|
||||
},
|
||||
components: {
|
||||
LoadingState,
|
||||
},
|
||||
props: {
|
||||
confirmationToken: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.confirmToken();
|
||||
},
|
||||
methods: {
|
||||
confirmToken() {
|
||||
Auth.verifyPasswordToken({
|
||||
confirmationToken: this.confirmationToken
|
||||
}).then(res => {
|
||||
window.location = res.data.redirect_url;
|
||||
}).catch(res => {
|
||||
window.location = '/';
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
async confirmToken() {
|
||||
try {
|
||||
const {
|
||||
data: { redirect_url: redirectURL },
|
||||
} = await Auth.verifyPasswordToken({
|
||||
confirmationToken: this.confirmationToken,
|
||||
});
|
||||
window.location = redirectURL;
|
||||
} catch (error) {
|
||||
window.location = DEFAULT_REDIRECT_URL;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -46,12 +46,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* global bus */
|
||||
|
||||
import { required, minLength } from 'vuelidate/lib/validators';
|
||||
import Auth from '../../api/auth';
|
||||
|
||||
import WootSubmitButton from '../../components/buttons/FormSubmitButton';
|
||||
import { DEFAULT_REDIRECT_URL } from '../../constants';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -81,7 +80,7 @@ export default {
|
||||
// If url opened without token
|
||||
// redirect to login
|
||||
if (!this.resetPasswordToken) {
|
||||
window.location = '/';
|
||||
window.location = DEFAULT_REDIRECT_URL;
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
@@ -118,7 +117,7 @@ export default {
|
||||
Auth.setNewPassword(credentials)
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
window.location = '/';
|
||||
window.location = DEFAULT_REDIRECT_URL;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<script>
|
||||
import { required, minLength, email } from 'vuelidate/lib/validators';
|
||||
import Auth from '../../api/auth';
|
||||
import { frontendURL } from '../../helper/URLHelper';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -71,7 +70,6 @@ export default {
|
||||
successMessage = res.data.message;
|
||||
}
|
||||
this.showAlert(successMessage);
|
||||
window.location = frontendURL('login');
|
||||
})
|
||||
.catch(error => {
|
||||
let errorMessage = this.$t('RESET_PASSWORD.API.ERROR_MESSAGE');
|
||||
|
||||
@@ -79,6 +79,7 @@ import Auth from '../../api/auth';
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import { DEFAULT_REDIRECT_URL } from '../../constants';
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin, alertMixin],
|
||||
@@ -132,7 +133,7 @@ export default {
|
||||
try {
|
||||
const response = await Auth.register(this.credentials);
|
||||
if (response.status === 200) {
|
||||
window.location = '/';
|
||||
window.location = DEFAULT_REDIRECT_URL;
|
||||
}
|
||||
} catch (error) {
|
||||
let errorMessage = this.$t('REGISTER.API.ERROR_MESSAGE');
|
||||
|
||||
Reference in New Issue
Block a user