Feature: SignIn with Twitter (#479)

* Add Twitter SignIn flow

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-02-11 14:27:38 +05:30
committed by GitHub
parent 272c481464
commit 30f4c08143
14 changed files with 249 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ export default {
},
methods: {
isActive(channel) {
return ['facebook', 'website'].includes(channel);
return ['facebook', 'website', 'twitter'].includes(channel);
},
onItemClick() {
if (this.isActive(this.channel)) {

View File

@@ -15,6 +15,9 @@
"FB": {
"HELP": "PS: By signing in, we only get access to your Page's messages. Your private messages can never be accessed by Chatwoot."
},
"TWITTER": {
"HELP": "To add your Twitter profile as a channel, you need to authenticate your Twitter Profile by clicking on 'Sign in with Twitter' "
},
"WEBSITE_CHANNEL": {
"TITLE": "Website channel",
"DESC": "Create a channel for your website and start supporting your customers via our website widget.",

View File

@@ -1,9 +1,11 @@
import Facebook from './channels/Facebook';
import Website from './channels/Website';
import Twitter from './channels/Twitter';
const channelViewList = {
facebook: Facebook,
website: Website,
twitter: Twitter,
};
export default {

View File

@@ -0,0 +1,27 @@
<template>
<div class="wizard-body columns content-box small-9">
<div class="login-init full-height text-center">
<form method="POST" action="/twitter/authorization">
<input type="hidden" name="user_id" :value="currentUserID" />
<woot-submit-button
icon-class="ion-social-twitter"
button-text="Sign in with Twitter"
type="submit"
/>
</form>
<p>{{ $t('INBOX_MGMT.ADD.TWITTER.HELP') }}</p>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters({
currentUserID: 'getCurrentUserID',
}),
},
};
</script>