Skip to content

Commit

Permalink
Merge pull request #209 from silinternational/fix-profile-bugs
Browse files Browse the repository at this point in the history
Fix profile bugs
  • Loading branch information
hobbitronics authored Jan 22, 2025
2 parents ffb07c5 + 0741977 commit e06db7a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
12 changes: 7 additions & 5 deletions src/2sv/Intro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ export default {
ProfileWizard,
},
async created() {
const thisStep = Steps.forPath(this.$route.path) || {}
const keyStep = Steps.next(thisStep)
const codesStep = Steps.next(keyStep)
if (thisStep.skip && keyStep.skip && codesStep.skip) {
this.$router.push('/profile/complete')
if (this.Steps) {
const thisStep = Steps.forPath(this.$route.path) || {}
const keyStep = Steps.next(thisStep)
const codesStep = Steps.next(keyStep)
if (thisStep.skip && keyStep.skip && codesStep.skip) {
this.$router.push('/profile/complete')
}
}
},
}
Expand Down
7 changes: 4 additions & 3 deletions src/2sv/key/Confirmed.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ProfileWizard ref="wizard">
<ProfileWizard>
<BasePage>
<template #header>
{{ $t('2sv.key.confirmed.header') }}
Expand All @@ -22,15 +22,16 @@

<script>
import ProfileWizard from '@/profile/ProfileWizard.vue'
import steps from '../../profile/steps'
export default {
name: 'ConfirmedKey',
components: {
ProfileWizard,
},
async created() {
await this.$nextTick() // best option I could figure out to ensure this.$refs.wizard was available
this.$refs.wizard.completed()
const step = steps.forPath(this.$route.path)
step.state = 'complete'
},
}
</script>
7 changes: 4 additions & 3 deletions src/2sv/smartphone/CodeVerified.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ProfileWizard ref="wizard">
<ProfileWizard>
<BasePage>
<template #header>
{{ $t('2sv.smartphone.codeVerified.header') }}
Expand All @@ -22,14 +22,15 @@

<script>
import ProfileWizard from '@/profile/ProfileWizard.vue'
import steps from '../../profile/steps'
export default {
components: {
ProfileWizard,
},
async created() {
await this.$nextTick() // best option I could figure out to ensure this.$refs.wizard was available
this.$refs.wizard.completed()
const step = steps.forPath(this.$route.path)
step.state = 'complete'
},
}
</script>
2 changes: 1 addition & 1 deletion src/2sv/smartphone/Intro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const hasBackup = (m) => {
}
const nextUrl = computed(() => {
if (!hasKey(mfa)) {
if (!hasKey(mfa) || mfa.numVerified < 3) {
return '/2sv/usb-security-key/intro'
}
if (!hasBackup(mfa)) {
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ async function main() {
app.config.globalProperties.$user = user

app.config.errorHandler = (err) => {
console.error('error: ', err)
eventBus.emit('error', err)
}

// catches method and async errors
window.onunhandledrejection = (event) => {
console.error('error: ', event.reason)
eventBus.emit('error', event.reason)
}

Expand Down
7 changes: 4 additions & 3 deletions src/password/CompleteReset.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ProfileWizard ref="wizard">
<ProfileWizard>
<BasePage>
<template #header>
{{ $t('password.reset.complete.header') }}
Expand All @@ -20,14 +20,15 @@

<script>
import ProfileWizard from '@/profile/ProfileWizard.vue'
import steps from '../profile/steps'
export default {
components: {
ProfileWizard,
},
async created() {
await this.$nextTick() // best option I could figure out to ensure this.$refs.wizard was available
this.$refs.wizard.completed()
const step = steps.forPath(this.$route.path)
step.state = 'complete'
},
}
</script>

0 comments on commit e06db7a

Please sign in to comment.