About
- This page is accesible to both logged in and logged out users. No middleware is defined for + This page is accessible to both logged in and logged out users. No middleware is defined for this page.
diff --git a/README.md b/README.md
index d606f3a1..11cbe792 100644
--- a/README.md
+++ b/README.md
@@ -84,11 +84,11 @@ You can also create your own middleware for full control.
### Auto-imports
-`useHanko` is exposed in the Vue part of your app to allow you direct access to the Hanko API. You can access the current user and much more. **Note**: It will return `null` on the server.
+`useHanko` and `$hanko` is exposed in the Vue part of your app to allow you direct access to the Hanko API. You can access the current user and much more. **Note**: It will return `null` on the server.
### Server utilities
-By default you can access a verified JWT context on `event.context.hanko`. (It will be undefined if the user is not logged in.) If you want to handle this yourself you can set `augmentContext: false`.
+By default, you can access a verified JWT context on `event.context.hanko`. (It will be undefined if the user is not logged in.) If you want to handle this yourself you can set `augmentContext: false`.
`verifyHankoEvent` is exposed in the Nitro part of your app to expose the underlying utility used to create `event.context.hanko` if you want to handle things manually.
diff --git a/package.json b/package.json
index 5a26c794..14e77e8d 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
},
"dependencies": {
"@nuxt/kit": "^4.0.0",
- "@teamhanko/hanko-elements": "1.5.2",
+ "@teamhanko/hanko-elements": "2.3.0",
"defu": "^6.1.4",
"jose": "^6.0.0",
"ufo": "^1.5.4"
diff --git a/playground/pages/about.vue b/playground/pages/about.vue
index c288fdb5..b9984822 100644
--- a/playground/pages/about.vue
+++ b/playground/pages/about.vue
@@ -2,7 +2,7 @@
- This page is accesible to both logged in and logged out users. No middleware is defined for
+ This page is accessible to both logged in and logged out users. No middleware is defined for
this page.
- This page is accesible to both logged in and logged out users. No middleware is defined for
+ This page is accessible to both logged in and logged out users. No middleware is defined for
this page. Use the navigation above to navigate to other pages.
- Only logged out users can see this pageAbout
Home
Log in
definePageMeta({
- middleware: ['hanko-logged-out'],
-})
+ Only logged out users can see this page
+ definePageMeta({
+ middleware: ['hanko-logged-out'],
+ })
+
You were redirected here from {{ $route.query.redirect }}, once you login, you'll be sent back automatically!
diff --git a/playground/pages/protected.vue b/playground/pages/protected.vue index 11a81886..ec1cf788 100644 --- a/playground/pages/protected.vue +++ b/playground/pages/protected.vue @@ -4,7 +4,7 @@ definePageMeta({ }) const hanko = useHanko() function logout() { - hanko!.user.logout() + hanko!.logout() } @@ -12,12 +12,18 @@ function logout() {- Only logged in users can see this page
definePageMeta({
- middleware: ['hanko-logged-in'],
-})
+ Only logged in users can see this page
+
+ definePageMeta({
+ middleware: ['hanko-logged-in'],
+ })
+
+
- Only logged in users can see this page
definePageMeta({
- middleware: ['hanko-logged-in'],
-})
+ Only logged in users can see this page
+
+ definePageMeta({
+ middleware: ['hanko-logged-in'],
+ })
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 664cffe8..5e327981 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -16,8 +16,8 @@ importers:
specifier: ^4.0.0
version: 4.3.1(magicast@0.5.1)
'@teamhanko/hanko-elements':
- specifier: 1.5.2
- version: 1.5.2
+ specifier: 2.3.0
+ version: 2.3.0
defu:
specifier: ^6.1.4
version: 6.1.4
@@ -1565,11 +1565,11 @@ packages:
peerDependencies:
eslint: ^9.0.0 || ^10.0.0
- '@teamhanko/hanko-elements@1.5.2':
- resolution: {integrity: sha512-RrOgSoKwHbysDOOffOHn3p8s/zXxY2qvWwZFQdMeEP8Qp/C/RQBwGOzax0Y2gySWflDHM2uu4+tW8dXB+mZfQg==}
+ '@teamhanko/hanko-elements@2.3.0':
+ resolution: {integrity: sha512-hMDecxL4gNNxk8mOwWxqaRvguSNPZ9QPrUVcjFP6kwZN3wHj47iD4A+htWFB+VKLWAqyDiioyx/MAM4HhPMsAQ==}
- '@teamhanko/hanko-frontend-sdk@1.5.2':
- resolution: {integrity: sha512-sSY2NGsJRndrC4HwxBIdog9gOGUzJ3EGKmEn7p+rzXzJaLik3ywJb25DloegPekMZQ8hwOzliF0uJh7kNxFgTA==}
+ '@teamhanko/hanko-frontend-sdk@2.3.0':
+ resolution: {integrity: sha512-rZkyWddmozkgpsC0mN+1FuxG2L7OCYsD3D040Njp1o73VyZFpvZ1rbBQv7eOI3V7qZc4rtgKc+fPizM1Hp2pCQ==}
'@teamhanko/preact-custom-element@4.2.2':
resolution: {integrity: sha512-3djCQr25IxQIgpidxD8J0fTQ7/hMuoa5Nmv7delQc6sX4kXgv9e/pE01cywpmGZLi69H1KUH4dmZ4cPPJQrsQQ==}
@@ -5866,15 +5866,15 @@ snapshots:
estraverse: 5.3.0
picomatch: 4.0.3
- '@teamhanko/hanko-elements@1.5.2':
+ '@teamhanko/hanko-elements@2.3.0':
dependencies:
'@denysvuika/preact-translate': 0.5.1(preact@10.28.3)
- '@teamhanko/hanko-frontend-sdk': 1.5.2
+ '@teamhanko/hanko-frontend-sdk': 2.3.0
'@teamhanko/preact-custom-element': 4.2.2(preact@10.28.3)
classnames: 2.5.1
preact: 10.28.3
- '@teamhanko/hanko-frontend-sdk@1.5.2':
+ '@teamhanko/hanko-frontend-sdk@2.3.0':
dependencies:
'@types/js-cookie': 3.0.6
diff --git a/src/module.ts b/src/module.ts
index 87823a5d..d9f66bb8 100644
--- a/src/module.ts
+++ b/src/module.ts
@@ -28,6 +28,8 @@ export interface ModuleOptions {
translations?: RegisterOptions['translations']
translationsLocation?: RegisterOptions['translationsLocation']
fallbackLanguage?: RegisterOptions['fallbackLanguage']
+ sessionCheckInterval?: RegisterOptions['sessionCheckInterval']
+ sessionTokenLocation?: RegisterOptions['sessionTokenLocation']
}
}
diff --git a/src/runtime/components.d.ts b/src/runtime/components.d.ts
index f4ff11c7..69357f37 100644
--- a/src/runtime/components.d.ts
+++ b/src/runtime/components.d.ts
@@ -7,7 +7,7 @@ declare module 'vue' {
* Currently supported values are "en" for English and "de" for German.
* If the value is omitted, "en" is used.
*/
- lang?: 'en' | 'de' | (string & {})
+ lang?: 'bn' | 'de' | 'en' | 'fr' | 'it' | 'pt-BR' | 'zh' | (string & {})
/** A space-separated list of experimental features to be enabled. See experimental features. */
experimental?: string
}>
@@ -16,7 +16,7 @@ declare module 'vue' {
* Currently supported values are "en" for English and "de" for German.
* If the value is omitted, "en" is used.
*/
- lang?: 'en' | 'de' | (string & {})
+ lang?: 'bn' | 'de' | 'en' | 'fr' | 'it' | 'pt-BR' | 'zh' | (string & {})
}>
HankoEvents: DefineComponent