becem-gharbi / nuxt-directus Goto Github PK
View Code? Open in Web Editor NEWUnofficial Directus client for Nuxt
License: MIT License
Unofficial Directus client for Nuxt
License: MIT License
For a site I made i'm requesting extra information in the user object, with the Directus SDK i would use the following
.users.me.read({
fields:[
'email',
'first_name',
'last_name',
'id',
'role',
'status',
// groups
'groups.groups_id',
'groups.id',
'groups.status',
'groups.type',
//favs
'favourites.id',
'favourites.collection',
'favourites.item'
],
})
My thought was to crate an option here in the fetchUser
that could be configured to add fields?
Any thoughts on this? I think this is simple enough that i can make a PR for if you want.
Hi! Thanks for your great module, works like a charm.
I have one problem though, since you build the SSO login link for directus with a fixed list of providers here:
I'm unable to use my provider, which has a custom/different name than the ones in the list.
Would it be possible to make this list just any string? Not sure why you would want to fix this list.
Cheers!
Currently the module stores the accessToken in a httpOnly: false,
. In order to secure the token I'd suggest to store it in a more secure httpOnly cookie, so that it's secured against XSS attacks.
nuxt-directus/src/runtime/composables/useDirectusSession.ts
Lines 37 to 49 in 5bb18b8
As the cookie than can't be read anymore from the JS, the auth-plugin as well as the useDirectusSession
composable needs to be refactored:
useState()
)Looking forwards to your thoughts on this :)
Instead of redirecting users to the home page or a generic dashboard upon logging in, it should remember the last page the user was on before clicking on the 'Login' button. After successful login, users should then be redirected back to this page.
Thinking about a solution where we can add the redirect page to the login function
const { data, error } = await login({
email: email.value,
password: password.value,
redirect: route
})
Where route could be string or route object.
Hi, Still in love with your module!
I love that it directly returns data but I think this part makes it also that meta data is not returned when requested.
nuxt-directus/src/runtime/directus.ts
Line 91 in 41d33ca
Got auth setup on my own custom app. But I am wondering if you could provide an example on how to call a field from a collection.
It hasn't clicked yet when looking at the demo. Something like pulling a string or image from a collection.
Thanks!
Can you share some examples how to download a file (say a PDF) file using this extension?
I have a collection called Topics and it has a one-to-many relationship with another collection called Articles. The one-to-many field name on Posts to Articles is called “articles”
Using t "@bg-dev/nuxt-directus": "2.3.1-beta", REST, I want to query for Topics where Status = “published” and for Topics ->articles where Status = “published”
I can filter Topics but filtering on Topics ->articles does not seem to work at all
Here is my code:
const fields = ['id', 'topic', 'default_open', { articles: ['id', 'title', 'status'] }]; const filter = { status: { _eq: 'published' } }; const _res = await useDirectusRest(readItems('learn_topics', { fields, filter }));
There's been a major release on the directus sdk due to a small breaking change: https://github.com/directus/directus/releases/tag/v10.6.2.
Shouldn't need any changes in this module except from increasing the version. V12 also has some (type) optimisations and fixes.
Summary:
Access tokens are lost upon reopening the browser, while refresh tokens persist.
Steps to Reproduce:
Expected Behavior:
In version 1, all tokens used to be stored in cookies. Although I appreciate the new approach with session-based tokens, it's problematic that the browser still retains the refresh token while losing the access token. Ideally, the system should be able to obtain a new access token using the existing refresh token without requiring the user to log in again.
Possible Solution:
I suggest implementing a mechanism that retrieves an access token during initialization if a refresh token exists and the access token is either empty or gone. This would maintain user authentication across browser sessions without compromising the benefits of using session-based tokens.
Going to collect some issues with authentication.
There is a big chance issues can still be caused upstream by the SDK
Currently experiencing issues with
nuxt-directus/src/runtime/plugins/auth.ts
Line 44 in 1bf7278
Hey there!
Thanks for upgrading to the new session mode for auth in your module so fast!
I just try to reinstall your module and got all sorts of dependencies errors (see below).
Any thoughts on what changed in the interim? My earlier nuxt-directus packages installed fine.
Cheers!
My package.json dependencies:
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxt/eslint-config": "^0.2.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@nuxtjs/i18n": "^8.1.1",
"@types/node": "^18.17.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"firebase-admin": "^11.10.1",
"firebase-functions": "^4.4.1",
"firebase-functions-test": "^3.1.0",
"nuxt": "npm:nuxt3@latest",
"prettier": "^3.2.5",
"typescript": "^5.4.2"
},
"dependencies": {
"@pinia/nuxt": "^0.4.11",
"@vueform/slider": "^2.1.7",
"bootstrap": "^5.3.0",
"dayjs": "^1.11.9",
"pinia": "^2.1.6",
"sass": "^1.64.1",
"swiper": "^10.0.4",
"vee-validate": "^4.11.1",
"vue-clipboard3": "^2.0.0",
"vue-timer-hook": "^1.0.84",
"vue3-carousel": "^0.3.1",
"vue3-toastify": "^0.1.12",
"yup": "^1.2.0"
}
The error:
# npm resolution error report
While resolving: nuxt-app@undefined
Found: [email protected]
node_modules/vue
peer vue@"^3.3.4" from @nuxt/[email protected]
node_modules/@nuxt/vite-builder
@nuxt/vite-builder@"3.11.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@">=2.7 || >=3" from @unhead/[email protected]
node_modules/@unhead/vue
@unhead/vue@"^1.8.20" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@"^3.2.25" from @vitejs/[email protected]
node_modules/@vitejs/plugin-vue
@vitejs/plugin-vue@"^5.0.4" from @nuxt/[email protected]
node_modules/@nuxt/vite-builder
@nuxt/vite-builder@"3.11.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@"^3.0.0" from @vitejs/[email protected]
node_modules/@vitejs/plugin-vue-jsx
@vitejs/plugin-vue-jsx@"^3.1.0" from @nuxt/[email protected]
node_modules/@nuxt/vite-builder
@nuxt/vite-builder@"3.11.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peerOptional vue@"^2.7.0 || ^3.2.25" from @vue-macros/[email protected]
node_modules/@vue-macros/common
@vue-macros/common@"^1.8.0" from [email protected]
node_modules/unplugin-vue-router
unplugin-vue-router@"^0.7.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@"3.4.21" from @vue/[email protected]
node_modules/@vue/server-renderer
@vue/server-renderer@"3.4.21" from [email protected]
vue@"^3.4.21" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@"^2.6.14 || ^3.3.0" from [email protected]
node_modules/pinia
pinia@">=2.1.0" from @pinia/[email protected]
node_modules/@pinia/nuxt
@pinia/nuxt@"^0.4.11" from the root project
pinia@"^2.1.6" from the root project
peer vue@"^3.0.0-0 || ^2.6.0" from [email protected]
node_modules/pinia/node_modules/vue-demi
vue-demi@">=0.14.5" from [email protected]
node_modules/pinia
pinia@">=2.1.0" from @pinia/[email protected]
node_modules/@pinia/nuxt
@pinia/nuxt@"^0.4.11" from the root project
pinia@"^2.1.6" from the root project
peer vue@"^3.3.11" from [email protected]
node_modules/vee-validate
vee-validate@"^4.11.1" from the root project
peer vue@"^3.0.0" from [email protected]
node_modules/vue-i18n
peerOptional vue-i18n@"*" from @intlify/[email protected]
node_modules/@intlify/unplugin-vue-i18n
@intlify/unplugin-vue-i18n@"^2.0.0" from @nuxtjs/[email protected]
node_modules/@nuxtjs/i18n
dev @nuxtjs/i18n@"^8.1.1" from the root project
vue-i18n@"^9.9.0" from @nuxtjs/[email protected]
node_modules/@nuxtjs/i18n
dev @nuxtjs/i18n@"^8.1.1" from the root project
peer vue@"^3.2.0" from [email protected]
node_modules/vue-router
vue-router@"^4.2.5" from @nuxtjs/[email protected]
node_modules/@nuxtjs/i18n
dev @nuxtjs/i18n@"^8.1.1" from the root project
vue-router@"^4.3.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peerOptional vue-router@"^4.1.0" from [email protected]
node_modules/unplugin-vue-router
unplugin-vue-router@"^0.7.0" from [email protected]
node_modules/nuxt
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
peer nuxt@"^3.9.0" from @nuxt/[email protected]
node_modules/@nuxt/devtools-kit
@nuxt/devtools-kit@"1.0.8" from @nuxt/[email protected]
node_modules/@nuxt/devtools
@nuxt/devtools@"^1.0.8" from [email protected]
dev @nuxt/devtools@"latest" from the root project
dev nuxt@"npm:nuxt3@latest" from the root project
peer vue@"^3.2.0" from [email protected]
node_modules/vue-timer-hook
vue-timer-hook@"^1.0.84" from the root project
peer vue@"^3.2.0" from [email protected]
node_modules/vue3-carousel
vue3-carousel@"^0.3.1" from the root project
peerOptional vue@">=3.2.0" from [email protected]
node_modules/vue3-toastify
vue3-toastify@"^0.1.12" from the root project
Could not resolve dependency:
dev @bg-dev/nuxt-directus@"*" from the root project
Conflicting peer dependency: [email protected]
node_modules/vue
peer vue@">= 2.5 < 2.7" from @vue/[email protected]
node_modules/@vue/composition-api
peerOptional @vue/composition-api@"^1.0.0" from @vue/[email protected]
node_modules/@vue/apollo-composable
peer @vue/apollo-composable@"^4.0.1" from @bg-dev/[email protected]
node_modules/@bg-dev/nuxt-directus
dev @bg-dev/nuxt-directus@"*" from the root project
Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
My TS compiler gives error Argument of type 'string' is not assignable to parameter of type 'never'.
when using your example code for readItems through rest. The error is shown at the collection name ("country" in this example.) Typescript complier is 5.4.5
import {
readItems,
useAsyncData,
useDirectusRest,
} from "#imports";
const { data, refresh } = await useAsyncData(() =>
useDirectusRest(readItems("country")),
);
Just wondering, I'm not sure which one to use, thanks!
In src/runtime/plugins/rest.ts, import { useDirectusSession } from '#imports' raises an error when auth.enabled is false because useDirectusSession is not auto imported anymore.
Finally getting around to updating this from 2.0.1 to 2.1.1 and on the latest version I am seeing this now. I don't see anything different in the config thats needed for nuxt. Am I supposed to be setting something new on pages now?
Hi !
Thanks again for your work !
I noticed that as soon as I try to access a page that doesn't exists, the cookie get destroyed and therefor the user get disconnected.
Log in -> Cookie inserted -> type <yoursite>/unknownpage
-> Cookie is destroyed -> Nuxt error 404 -> click on back to home -> user is now unlogged.
Another behavior with global auth:
Log in -> Cookie inserted -> type <yoursite>/unknownpage
-> Redirect to /login page (even tho we're still supposed to be logged in) -> type user + password + submit form -> Nuxt error 404 -> Back to home -> still unlogged
Is it supposed to happen ?
Hi,
I'm noticing that there isn't aggregate()
function, so it's impossible to use it with useDirectusRest()
, for now I installed the SDK and I imported the aggregate function myself.
I tried to understand why in the repo, but honestly I don't understand how auto import works in Nuxt (part of why I'm not a fan of it), is it supposed to globally import all functions from what you are using inside composables folder inside your module ?
This module looks really promising but as there's a new SDK coming soon (currently in beta) I'm wondering if you already do have plans to upgrade the module.
The new SDK doesn't rely on axios anymore but on fetch, so that some refactoring wold be necessary.
When I call the logout() composable I get the error below even though I actually get logged out. i.e the user is null.
I'm using:
"@bg-dev/nuxt-directus": "2.3.0-beta",
"nuxt": "^3.6.5",
console.log is printing this
Uncaught (in promise) FetchError: (400 Bad Request (http://127.0.0.1:8055/auth/logout))
and the network log is showing this error
message: "Invalid payload. \"refresh_token\" is required in either the JSON payload or Cookie."
I called logout as follows:
<script lang="ts" setup>
const { logout } = useDirectusAuth();
const handleSignout = async () => await logout();
</script>
<template>
<div>
<UButton label="Sign Out" @click="handleSignout"></UButton>
</div>
<template>
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@bg-dev/nuxt-naiveui
, @nuxtjs/tailwindcss
, eslint
)@nuxt/kit
, @nuxt/schema
, nuxt
)demo/package.json
@bg-dev/nuxt-directus ^0.1.4
@bg-dev/nuxt-naiveui ^1.1.1
@nuxtjs/tailwindcss ^6.7.0
nuxt 3.5.3
package.json
@directus/sdk ^10.3.3
@nuxt/kit ^3.5.0
defu ^6.1.2
@nuxt/module-builder ^0.4.0
@nuxt/schema ^3.5.0
@nuxtjs/eslint-config-typescript ^12.0.0
changelogen ^0.5.3
eslint ^8.41.0
nuxt ^3.5.0
playground/package.json
It's that time again where the SDK had a version bump from v12 to v13. The main reason for the increase was the possible breaking changes due to adding support for reading/updating extensions in the SDK (came with directus release v10.7.0). Therewith I don't think this module needs any changes, as but haven't tested it yet.
Apart from that, these are the changes that could have an impact on the module:
Do you want me to open a PR, or will you check / test it yourself? :)
Thanks as always!
Upon using an array to add fields in the query, the query tends to become considerably lengthy, particularly when there are more than 15-ish fields. I managed to resolve this issue for myself by incorporating the .join(',')
function; however, this solution may inadvertently introduce unanticipated issues for other users.
There are two methods to include fields in the query:
Utilizing a string: fields: "field1,field2,field3,field4"
Utilizing an array: fields: ['field1','field2','field3','field4']
The root of the problem appears to be related to the QS library, specifically the line const query = qs.stringify(options?.params);. Unfortunately, I am yet to identify a definitive fix for this issue.
Here is an example of fields that caused problems when used with nuxt-directus, but did not pose any issues with the SDK itself:
export const fieldsUserSimple = [
'email',
'first_name',
'last_name',
'id',
'role',
'status',
'groups.groups_id',
'groups.id',
'groups.status',
'groups.type',
'favourites.id',
'favourites.collection',
'favourites.item',
'broadcasts.id',
'broadcasts.broadcasts_id',
'user_module_state.id',
'user_module_state.video_time',
'user_module_state.status',
'user_module_state.date_completed',
'user_module_state.custom_state',
'user_module_state.module_content',
// >>>>> it was broken after adding this ones.
'user_module_state.module_content.id',
'user_module_state.module_content.module',
'user_module_state.module_content.duration',
]
Hi!
Is it possible to use runtimeConfig with this plugin? At the moment the config values for this (wonderful) module are not using runtimeConfig.
Cheers!
Kees.
Question as I'm new to PNPM. Does anything need changed in your awesome module to be able to install it via PNPM since thats the package manager of choice from Directus now?
Excited to use this. Thanks!
Hey! Noticed that url arguments are sanitized when you are redirected to auth page and than back to where you were going.
Wondering if that could be added when you have time.
Thanks!
Great new release. Just moved to the new beta and for some reason anytime I call logout its giving me a 400 error.
Updated logout to use the method.
Hey! Been working on a new project and for some reason refreshing the page seems to log me out. But when using NuxtLink, it routes me fine throughout my app while maintaining auth.
Not sure if I am missing something. Everything is set as it should be I believe
This project deserves more attention, 100x times better compared to other nuxt3 module <3
1000 times thanks.
Hey again 👋🏼
The command import is missing the user-util commands (view in directus SDK)
Lines 149 to 155 in 2225380
I haven't checked all commands, but in general it feels like a bunch of commands are missing.
What do you think about replacing the list and importer with addImportsDir
to always have all rest-commands available?
Amateur 😅
Hi,
I discovered your nuxt-directus plugin and it seems perfect - using just plain directus SDK and introducing simple authentication.
But when I was experimenting with it I had some unexpected issues. Maybe I just don't understand properly how it is supposed to work.
I am able to log in and then display user info (using useUser
composable). But when I refresh the page in the browser, user info is gone. Is that how it's supposed to be?
Refresh request is not working. When the plugin sends the request, there is no JWT token attached. There is this error response from Directus:
{
"errors": [
{
"message": "Invalid payload. \"refresh_token\" is required in either the JSON payload or Cookie.",
"extensions": {
"code": "INVALID_PAYLOAD",
"reason": "\"refresh_token\" is required in either the JSON payload or Cookie"
}
}
]
}
I can see that there is the auth_token
cookie set, but just for localhost:3000.
I am using the default ports for both nuxt (3000) and directus (8055).
I appreciate any advice about what I'm doing wrong (or maybe just don't understand the logic behind this plugin).
Thanks!
[nuxt] Calling `useRoute` within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.
I think its pointing to
called viaIt's just a warning but maybe there is a way to get around it.
Seeing this when upgrading to 2.3.
ERROR [unimport] failed to find "clearNuxtState" imported from "#imports" (x4)
Hey,
I don't get the way to get a folder by name. Can someone help me :(
Best regards
Not happening with pnpm i
Tried npm i
with and without shamefully-hoist=true
❯ npm i
> postinstall
> nuxt prepare
Nuxi 3.6.5 1:50:14 PM
ERROR Error while requiring module nuxt-apollo: Error: Cannot find module '/Users/username/Sites/xxxx/gh-tpl/nuxt-apollo' 1:50:15 PM
Require stack:
- /Users/username/Sites/xxxx/gh-tpl/index.js
ERROR Cannot find module '/Users/username/Sites/xxxx/gh-tpl/nuxt-apollo' 1:50:15 PM
Require stack:
- /Users/username/Sites/xxxx/gh-tpl/index.js
Require stack:
- index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Function.resolve (node:internal/modules/cjs/helpers:116:19)
at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:250100)
at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:2230:29)
at requireModule (node_modules/@nuxt/kit/dist/index.mjs:2240:24)
at loadNuxtModuleInstance (node_modules/@nuxt/kit/dist/index.mjs:2435:90)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2408:47)
at async setup (node_modules/@bg-dev/nuxt-directus/dist/module.mjs:60:7)
at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2140:17)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2409:95)
npm ERR! code 1
npm ERR! path /Users/username/Sites/xxxx/gh-tpl
npm ERR! command failed
npm ERR! command sh -c nuxt prepare
Hi,
I can't get to work the DirectusSchema interface augmentation through d.ts
. But without pnpm workspace
it works great.
My current workspace is:
- apps
- directus
- frontend
- types/global.d.ts
- tsconfig.ts
- libs
- now empty
Inside the global.d.ts
I have the exact same code as the documentation in the readme
Inside the tsconfig
I properly added the type roots to the correct folder.
BUT readItems
Function for example is typed as readItems<object>
since it can't seem to find the global schema declared in global.d.ts
, and it defaults it at object
.
What I also noticed is that pnpm
seems to hoist the SDK in the root workspace node_module
folder via symlink, and nuxt auto import it but not from the symlink but from root ../../../../node_modules/.pnpm/...
. I'm wondering if it's what is causing the issue, and the SDK can't find the Schema because of the hoisting.
Does it makes sense ?
I'm not sure at all though
Hi,
Let me start with, this is not a bug but merely a question.
I'm using nuxt i18n in my project and whenever the auth middleware is hit it will forward me to /login (as is configured in nuxt.config.ts).
The question is, any idea on how to use locale paths in that configuration in nuxt.config.ts? The middleware should redirect me to /en/login or /nl/login for example.
Thanks!
How does the user data get fetched from directus?
If I made some changes to the user data directly in directus
The changes are not instantly reflected in the frontend. Even if I do a hard browser refresh or call the fetchUser() or readMe() functions on app startup, login page, or at the press of a button.
However, the changes do get reflected in the frontend after some time delay.
It looks like changes to user data are fetched on a timely basis and not ad hoc at an event
Hi!
I'm using this to pick up content:
this.webshopBanners = await useDirectusRest<
DirectusCollections["banners"]
>(
readItems("banners", {
fields: ["*", "translations"],
}),
);
I would like to also get relational fields from the translations relation. However, if I type "translations.*" as I would normally do, my Typescript compiler says that this is not a valid entry in the fields array.
What is the best approach?
Cheers!
Directus 10.10 introduced a new authentication mode "session" which stores a session token as cookie.
This makes a bunch of things a bit easier, as multi-tabs logins are handled by default and assets can be requested without a token in the query.
What do you think of adding this as an option to the module so that it relies on the sdk for that part too?
Haven't checked the possibilities in details, and how it works with nuxt yet, but would like to hear you thoughts about it 🎉
More information: directus/directus#21239
Hi,
I have forced token refresh to fail on purpose to see how this case is handled. I can see that after unsuccessful refresh the auth cookies are gone, but useUser() still keeps the user data, until I refresh the browser window.
Is it somehow possible to logout user automatically in case of token refresh failure?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.