mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-03 13:45:59 +01:00
17 lines
467 B
JavaScript
Vendored
17 lines
467 B
JavaScript
Vendored
/**
|
|
* Allows an authenticated user to access the main view only if he owns at least one twofaccount.
|
|
* Push to the starter view otherwise.
|
|
*/
|
|
export default function starter({ to, next, stores }) {
|
|
const { twofaccounts } = stores
|
|
|
|
if (twofaccounts.isEmpty) {
|
|
twofaccounts.refresh().then(() => {
|
|
if (twofaccounts.isEmpty) {
|
|
next({ name: 'start' });
|
|
}
|
|
else next()
|
|
})
|
|
}
|
|
else next()
|
|
} |