File tree Expand file tree Collapse file tree 7 files changed +25
-17
lines changed
integration/templates/nuxt-node/app Expand file tree Collapse file tree 7 files changed +25
-17
lines changed Original file line number Diff line number Diff 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 ) ) {
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<template >
2- <SignIn path =" /sign-in " />
2+ <SignIn signUpUrl =" /sign-up " />
33</template >
Original file line number Diff line number Diff line change 11<template >
2- <SignUp path =" /sign-up " />
2+ <SignUp signInUrl =" /sign-in " />
33</template >
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments