Skip to content

Commit fc4a47e

Browse files
ccci-codeChristophWurst
authored andcommitted
Update AccountForm.vue so Reconnect button works for Microsoft accounts
Also replace Google with Microsoft for button labels and feedback Signed-off-by: ccci-code <[email protected]> Signed-off-by: Christoph Wurst <[email protected]>
1 parent a605cc7 commit fc4a47e

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

src/components/AccountForm.vue

+22-10
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ export default {
372372
return this.loadingMessage ?? t('mail', 'Connecting')
373373
}
374374
if (this.mode === 'manual' && this.useOauth) {
375-
return this.account ? t('mail', 'Reconnect Google account') : t('mail', 'Sign in with Google')
375+
if (this.isGoogleAccount) {
376+
return this.account ? t('mail', 'Reconnect Google account') : t('mail', 'Sign in with Google')
377+
} else {
378+
return this.account ? t('mail', 'Reconnect Microsoft account') : t('mail', 'Sign in with Microsoft')
379+
}
376380
}
377381
return this.account ? t('mail', 'Save') : t('mail', 'Connect')
378382
},
@@ -557,16 +561,15 @@ export default {
557561
const account = await this.$store.dispatch('startAccountSetup', data)
558562
if (this.useOauth) {
559563
this.loadingMessage = t('mail', 'Awaiting user consent')
560-
this.feedback = t('mail', 'Account created. Please follow the pop-up instructions to link your Google account')
561-
try {
562564
if (this.isGoogleAccount) {
565+
this.feedback = t('mail', 'Account created. Please follow the pop-up instructions to link your Google account')
563566
await getUserConsent(
564567
this.googleOauthUrl
565568
.replace('_accountId_', account.id)
566569
.replace('_email_', encodeURIComponent(account.emailAddress)),
567570
)
568571
} else {
569-
// Microsoft
572+
this.feedback = t('mail', 'Account created. Please follow the pop-up instructions to link your Microsoft account')
570573
await getUserConsent(
571574
this.microsoftOauthUrl
572575
.replace('_accountId_', account.id)
@@ -592,13 +595,22 @@ export default {
592595
})
593596
if (this.useOauth) {
594597
this.loadingMessage = t('mail', 'Awaiting user consent')
595-
this.feedback = t('mail', 'Account updated. Please follow the pop-up instructions to reconnect your Google account')
596598
try {
597-
await getUserConsent(
598-
this.googleOauthUrl
599-
.replace('_accountId_', account.id)
600-
.replace('_email_', encodeURIComponent(account.emailAddress)),
601-
)
599+
if (this.isGoogleAccount) {
600+
this.feedback = t('mail', 'Account updated. Please follow the pop-up instructions to reconnect your Google account')
601+
await getUserConsent(
602+
this.googleOauthUrl
603+
.replace('_accountId_', account.id)
604+
.replace('_email_', encodeURIComponent(account.emailAddress))
605+
)
606+
} else {
607+
this.feedback = t('mail', 'Account updated. Please follow the pop-up instructions to reconnect your Microsoft account')
608+
await getUserConsent(
609+
this.microsoftOauthUrl
610+
.replace('_accountId_', account.id)
611+
.replace('_email_', encodeURIComponent(account.emailAddress))
612+
)
613+
}
602614
} catch (e) {
603615
// Undo changes
604616
await this.$store.dispatch('updateAccount', {

0 commit comments

Comments
 (0)