upd: revert back to original, keep some modifications

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

View file

@ -50,7 +50,6 @@ import * as os from '@/os.js';
import { $i, login } from '@/account.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { appendQuery, query } from '@/scripts/url.js';
const props = defineProps<{
session: string;
@ -77,8 +76,9 @@ async function accept(): Promise<void> {
if (props.callback) {
const cbUrl = new URL(props.callback);
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 }));
cbUrl.searchParams.set('session', props.session);
console.log(cbUrl.href);
location.href = cbUrl.href;
}
}