merge: upstream
This commit is contained in:
commit
5db583a3eb
701 changed files with 50809 additions and 13660 deletions
|
|
@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import MkSignin from '@/components/MkSignin.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
|
|
@ -59,20 +59,20 @@ const props = defineProps<{
|
|||
permission: string; // コンマ区切り
|
||||
}>();
|
||||
|
||||
const _permissions = $computed(() => props.permission ? props.permission.split(',') : []);
|
||||
const _permissions = computed(() => props.permission ? props.permission.split(',') : []);
|
||||
|
||||
let state = $ref<string | null>(null);
|
||||
const state = ref<string | null>(null);
|
||||
|
||||
async function accept(): Promise<void> {
|
||||
state = 'waiting';
|
||||
state.value = 'waiting';
|
||||
await os.api('miauth/gen-token', {
|
||||
session: props.session,
|
||||
name: props.name,
|
||||
iconUrl: props.icon,
|
||||
permission: _permissions,
|
||||
permission: _permissions.value,
|
||||
});
|
||||
|
||||
state = 'accepted';
|
||||
state.value = 'accepted';
|
||||
if (props.callback) {
|
||||
const cbUrl = new URL(props.callback);
|
||||
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
||||
|
|
@ -82,16 +82,16 @@ async function accept(): Promise<void> {
|
|||
}
|
||||
|
||||
function deny(): void {
|
||||
state = 'denied';
|
||||
state.value = 'denied';
|
||||
}
|
||||
|
||||
function onLogin(res): void {
|
||||
login(res.i);
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
title: 'MiAuth',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue