feat: update re-auth ui
This commit is contained in:
+2
-18
@@ -1,35 +1,19 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import InboxReconnectionRequired from '../../components/InboxReconnectionRequired.vue';
|
||||
import googleClient from 'dashboard/api/channel/googleClient';
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
|
||||
const props = defineProps({
|
||||
inbox: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const isRequestingAuthorization = ref(false);
|
||||
|
||||
const inboxEmail = computed(() => {
|
||||
if (props.inbox.imap_login && props.inbox.imap_enabled) {
|
||||
return props.inbox.imap_login;
|
||||
}
|
||||
return props.inbox.email;
|
||||
});
|
||||
|
||||
async function requestAuthorization() {
|
||||
try {
|
||||
isRequestingAuthorization.value = true;
|
||||
const response = await googleClient.generateAuthorization({
|
||||
email: inboxEmail.value,
|
||||
});
|
||||
const response = await googleClient.generateAuthorization();
|
||||
|
||||
const {
|
||||
data: { url },
|
||||
|
||||
+1
-10
@@ -6,13 +6,6 @@ import microsoftClient from 'dashboard/api/channel/microsoftClient';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
|
||||
const props = defineProps({
|
||||
inbox: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const isRequestingAuthorization = ref(false);
|
||||
@@ -20,9 +13,7 @@ const isRequestingAuthorization = ref(false);
|
||||
async function requestAuthorization() {
|
||||
try {
|
||||
isRequestingAuthorization.value = true;
|
||||
const response = await microsoftClient.generateAuthorization({
|
||||
email: props.inbox.email,
|
||||
});
|
||||
const response = await microsoftClient.generateAuthorization();
|
||||
|
||||
const {
|
||||
data: { url },
|
||||
|
||||
Reference in New Issue
Block a user