mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-11 16:58:58 +01:00
Fix landing on Start view while twofaccounts collection is not empty
This commit is contained in:
parent
26511954c4
commit
a4011388ca
@ -2,11 +2,11 @@
|
|||||||
* Allows an authenticated user to access the main view only if he owns at least one twofaccount.
|
* Allows an authenticated user to access the main view only if he owns at least one twofaccount.
|
||||||
* Push to the starter view otherwise.
|
* 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
|
const { twofaccounts } = stores
|
||||||
|
|
||||||
if (twofaccounts.isEmpty) {
|
if (twofaccounts.isEmpty) {
|
||||||
twofaccounts.fetch().then(() => {
|
await twofaccounts.fetch().then(() => {
|
||||||
if (twofaccounts.isEmpty) {
|
if (twofaccounts.isEmpty) {
|
||||||
next({ name: 'start' })
|
next({ name: 'start' })
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
function LegacysignIn(e) {
|
function LegacysignIn(e) {
|
||||||
notify.clear()
|
notify.clear()
|
||||||
form.post('/user/login', {returnError: true})
|
form.post('/user/login', {returnError: true})
|
||||||
.then(response => {
|
.then(async (response) => {
|
||||||
user.loginAs({
|
await user.loginAs({
|
||||||
name: response.data.name,
|
name: response.data.name,
|
||||||
email: response.data.email,
|
email: response.data.email,
|
||||||
preferences: response.data.preferences,
|
preferences: response.data.preferences,
|
||||||
|
Loading…
Reference in New Issue
Block a user