Skip to content

Commit dfbe011

Browse files
committed
fixed 2fa login attempt and redirect
1 parent 9ea8e0e commit dfbe011

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

resources/js/pages/auth/TwoFactorChallenge.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
</template>
2828

2929
<script>
30+
import { mapActions } from 'pinia'
31+
import { useAuthStore } from '@/stores/auth.js'
3032
import Logo from '@/components/Logo.vue'
3133
3234
export default {
@@ -40,13 +42,14 @@ export default {
4042
Logo,
4143
},
4244
methods: {
45+
...mapActions(useAuthStore, ['attempt_user']),
4346
login() {
4447
this.errors = null
4548
axios.post('/two-factor-challenge', { code: this.code, recovery_code: this.code })
4649
.then((response) => {
4750
if (response.status !== 204) return
4851
49-
this.$store.dispatch('attempt_user')
52+
this.attempt_user()
5053
.then(() => {
5154
this.$router.replace({ name: 'Home' })
5255
})

0 commit comments

Comments
 (0)