upd: use computed on permissions

This commit is contained in:
Mar0xy 2023-11-03 00:27:27 +01:00
parent 4856699bd6
commit 335de75b66
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828

View file

@ -60,7 +60,7 @@ const props = defineProps<{
permission: string; // permission: string; //
}>(); }>();
const _permissions = props.permission ? props.permission.split(',') : []; const _permissions = $computed(() => props.permission ? props.permission.split(',') : []);
let state = $ref<string | null>(null); let state = $ref<string | null>(null);
@ -77,6 +77,7 @@ async function accept(): Promise<void> {
if (props.callback) { if (props.callback) {
const cbUrl = new URL(props.callback); const cbUrl = new URL(props.callback);
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url'); if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url');
console.log(props.callback, props.session);
location.href = appendQuery(props.callback, query({ session: props.session })); location.href = appendQuery(props.callback, query({ session: props.session }));
} }
} }