upd: move the prompting of the id verification from page into router
This commit is contained in:
parent
2eaff3388f
commit
74e720c294
6 changed files with 54 additions and 13 deletions
24
packages/frontend/src/scripts/confirm-id.ts
Normal file
24
packages/frontend/src/scripts/confirm-id.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: marie and sharkey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { $i } from '@/account.js';
|
||||
import { popup } from '@/os.js';
|
||||
|
||||
export function confirmId(path?: string) {
|
||||
if ($i && !$i.idCheckRequired) return;
|
||||
|
||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/SkStripeIdDialog.vue')), {
|
||||
}, {
|
||||
closed: () => {
|
||||
dispose()
|
||||
if (path) {
|
||||
window.location.href = path;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
throw new Error('id confirmation required');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue