Skip to content

Commit e9bf1e2

Browse files
committed
Refactor account-related views and tests
- Updated FormRegister.test.ts to use TypeScript and improved test structure. - Replaced PageEmailVerificationRequest.test.js with PageEmailVerificationRequest.test.ts, enhancing test coverage and structure. - Created PageForgotPassword.test.ts to replace the previous JavaScript test file, adding comprehensive tests for the forgot password flow. - Converted PageRegister.test.js to PageRegister.test.ts, ensuring TypeScript usage and improved test clarity. - Refactored PageEmailVerificationRequest.vue to streamline the email verification process and improve code readability. - Enhanced PageForgotPassword.vue to include a multi-step process for password recovery, improving user experience. - Updated PageLogin.vue to utilize router links instead of emitted events for navigation, simplifying the component logic. - Refactored PageRegister.vue to include a redirect if registration is disabled, improving user flow.
1 parent 50e0fc8 commit e9bf1e2

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

app/assets/components/NavBar.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<script setup>
2-
import { useRouter } from 'vue-router'
32
import { useAuthStore } from '@userfrosting/sprinkle-account/stores'
43
import { useConfigStore } from '@userfrosting/sprinkle-core/stores'
5-
const router = useRouter()
64
const config = useConfigStore()
75
86
// Logout API variables
@@ -15,11 +13,8 @@ const auth = useAuthStore()
1513
<UFNavBarItem
1614
:to="{ name: 'account.register' }"
1715
:label="$t('REGISTER')"
18-
v-if="!auth.isAuthenticated" />
19-
<UFNavBarLogin
20-
v-if="!auth.isAuthenticated"
21-
@goto-login="router.push({ name: 'account.login' })"
22-
@goto-registration="router.push({ name: 'account.register' })" />
16+
v-if="!auth.isAuthenticated && useConfigStore().get('site.registration.enabled')" />
17+
<UFNavBarLogin v-if="!auth.isAuthenticated" />
2318
<UFNavBarUserCard
2419
v-if="auth.isAuthenticated"
2520
:username="auth.user.full_name"

0 commit comments

Comments
 (0)