Skip to content

Commit a99f257

Browse files
committed
chore: use wrapped ui components
1 parent a69c7c3 commit a99f257

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
lines changed

integration/templates/nuxt-node/app/middleware/auth.global.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default defineNuxtRouteMiddleware(to => {
22
const { userId } = useAuth();
33

44
const isPublicPage = createRouteMatcher(['/sign-in(.*)', '/sign-up(.*)']);
5-
const isProtectedPage = createRouteMatcher(['/user-profile(.*)', '/organization-profile(.*)']);
5+
const isProtectedPage = createRouteMatcher(['/user-profile(.*)']);
66

77
// Is authenticated and trying to access a public page
88
if (userId.value && isPublicPage(to)) {

integration/templates/nuxt-node/app/pages/hash/sign-in.vue renamed to integration/templates/nuxt-node/app/pages/hash/sign-in/[...slug].vue

File renamed without changes.

integration/templates/nuxt-node/app/pages/organization-profile/[...slug].vue

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<SignIn path="/sign-in" />
2+
<SignIn signUpUrl="/sign-up" />
33
</template>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<SignUp path="/sign-up" />
2+
<SignUp signInUrl="/sign-in" />
33
</template>

integration/templates/nuxt-node/app/pages/user-profile/[...slug].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { data: user } = await useFetch('/api/me');
33
</script>
44

55
<template>
6-
<UserProfile path="/user-profile" />
6+
<UserProfile />
77
<ul>
88
<li>First name: {{ user.firstName }}</li>
99
<li>Email: {{ user.emailAddresses[0].emailAddress }}</li>

packages/nuxt/src/module.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,28 @@ export default defineNuxtModule<ModuleOptions>({
137137
},
138138
]);
139139

140-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
141-
const components: Array<keyof typeof import('@clerk/vue')> = [
142-
// Authentication Components
140+
// Components that use path-based routing (wrapped components)
141+
const wrappedComponents = [
143142
'SignIn',
144143
'SignUp',
144+
'UserProfile',
145+
'OrganizationProfile',
146+
'CreateOrganization',
147+
'OrganizationList',
148+
] as const;
149+
150+
wrappedComponents.forEach(component => {
151+
void addComponent({
152+
name: component,
153+
export: component,
154+
filePath: resolver.resolve('./runtime/components'),
155+
});
156+
});
157+
158+
// Other components exported directly from @clerk/vue
159+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
160+
const otherComponents: Array<keyof typeof import('@clerk/vue')> = [
161+
// Authentication Components
145162
'GoogleOneTap',
146163
// Unstyled Components
147164
'SignInButton',
@@ -150,12 +167,8 @@ export default defineNuxtModule<ModuleOptions>({
150167
'SignInWithMetamaskButton',
151168
// User Components
152169
'UserButton',
153-
'UserProfile',
154170
// Organization Components
155-
'CreateOrganization',
156-
'OrganizationProfile',
157171
'OrganizationSwitcher',
158-
'OrganizationList',
159172
// Billing Components
160173
'PricingTable',
161174
// Control Components
@@ -170,10 +183,8 @@ export default defineNuxtModule<ModuleOptions>({
170183
'SignedIn',
171184
'SignedOut',
172185
'Waitlist',
173-
// API Keys Components
174-
'APIKeys',
175186
];
176-
components.forEach(component => {
187+
otherComponents.forEach(component => {
177188
void addComponent({
178189
name: component,
179190
export: component,

0 commit comments

Comments
 (0)