mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-14 06:03:58 +01:00
feat(MiAuth): アクセストークンの発行に失敗した場合コールバックに遷移しないようにする (MisskeyIO#831)
Cherry-picked from TeamNijimiss/misskey@800359623e Co-authored-by: nafu-at <satsuki@nafusoft.dev>
This commit is contained in:
parent
e8bf6285cb
commit
f6f682d59d
1 changed files with 10 additions and 10 deletions
|
@ -59,18 +59,18 @@ async function onAccept(token: string) {
|
|||
name: props.name,
|
||||
iconUrl: props.icon,
|
||||
permission: _permissions.value,
|
||||
}, token).catch(() => {
|
||||
}, token).then(() => {
|
||||
if (props.callback && props.callback !== '') {
|
||||
const cbUrl = new URL(props.callback);
|
||||
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
||||
cbUrl.searchParams.set('session', props.session);
|
||||
location.href = cbUrl.toString();
|
||||
} else {
|
||||
authRoot.value?.showUI('success');
|
||||
}
|
||||
}).catch(() => {
|
||||
authRoot.value?.showUI('failed');
|
||||
});
|
||||
|
||||
if (props.callback && props.callback !== '') {
|
||||
const cbUrl = new URL(props.callback);
|
||||
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
||||
cbUrl.searchParams.set('session', props.session);
|
||||
location.href = cbUrl.toString();
|
||||
} else {
|
||||
authRoot.value?.showUI('success');
|
||||
}
|
||||
}
|
||||
|
||||
function onDeny() {
|
||||
|
|
Loading…
Reference in a new issue