mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 07:48:37 +02:00
Fix landing on Start view while twofaccounts collection is not empty
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
* 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, nextMiddleware, stores }) {
|
||||
export default async function starter({ to, next, nextMiddleware, stores }) {
|
||||
const { twofaccounts } = stores
|
||||
|
||||
if (twofaccounts.isEmpty) {
|
||||
twofaccounts.fetch().then(() => {
|
||||
await twofaccounts.fetch().then(() => {
|
||||
if (twofaccounts.isEmpty) {
|
||||
next({ name: 'start' })
|
||||
}
|
||||
|
Reference in New Issue
Block a user