chore: Adjust Chatwoot Config to deploy frontend as a separate app (#2347)

This commit is contained in:
Pranav Raj S
2021-05-28 19:21:16 +05:30
committed by GitHub
parent 3b39eb3e33
commit 25ba852b68
16 changed files with 53 additions and 60 deletions

View File

@@ -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>