mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 17:15:13 +00:00
upd: change the way miauth redirects
This commit is contained in:
parent
4da9d94a16
commit
4856699bd6
1 changed files with 2 additions and 2 deletions
|
@ -50,6 +50,7 @@ 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;
|
||||
|
@ -76,8 +77,7 @@ 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');
|
||||
cbUrl.searchParams.set('session', props.session);
|
||||
location.href = cbUrl.href;
|
||||
location.href = appendQuery(props.callback, query({ session: props.session }));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue