enhance(frontend): 外部アプリ認証画面の改良 (misskey-dev#14828)
Cherry-picked from 076cc953e2bcd9f7335e2d9799cdf902829816cb Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
parent
62e801bf3a
commit
d4bbae8d45
14 changed files with 964 additions and 226 deletions
|
@ -19,13 +19,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, ref, computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import type * as Misskey from 'misskey-js';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { getAccounts, addAccount as addAccounts, removeAccount as _removeAccount, login, $i } from '@/account.js';
|
||||
import { getAccounts, removeAccount as _removeAccount, login, $i, getAccountWithSigninDialog, getAccountWithSignupDialog } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
|
@ -74,22 +74,20 @@ async function removeAccount(account) {
|
|||
}
|
||||
|
||||
function addExistingAccount() {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {}, {
|
||||
done: async res => {
|
||||
await addAccounts(res.id, res.i);
|
||||
getAccountWithSigninDialog().then((res) => {
|
||||
if (res != null) {
|
||||
os.success();
|
||||
init();
|
||||
},
|
||||
}, 'closed');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createAccount() {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkSignupDialog.vue')), {}, {
|
||||
done: async res => {
|
||||
await addAccounts(res.id, res.i);
|
||||
switchAccountWithToken(res.i);
|
||||
},
|
||||
}, 'closed');
|
||||
getAccountWithSignupDialog().then((res) => {
|
||||
if (res != null) {
|
||||
switchAccountWithToken(res.token);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function switchAccount(account: any) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue