Replies: 1 comment
-
|
I've been using like this: user: async (ctx) => {
if (!ctx?.auth?.user) {
return null
}
return ctx.auth.user.toJSON()
},Maybe you could try it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
adonis v6, can someone help ?
this is the problem:
{ "level": 60, "time": 1743966675831, "pid": 133700, "hostname": "fullstack", "request_id": "jpvpmrp83t0l6ewu1nu2rnnv", "err": { "type": "TypeError", "message": "Cannot read properties of undefined (reading 'user')", "stack": "TypeError: Cannot read properties of undefined (reading 'user')\n at AlwaysProp.callback (file:///node/app/beta-fullstack/config/inertia.ts:14:54)\n at Inertia.#resolveProp (file:///node/app/beta-fullstack/build/node_modules/@adonisjs/inertia/build/chunk-W7TVEB4V.js:155:32)\n at file:///node/app/beta-fullstack/build/node_modules/@adonisjs/inertia/build/chunk-W7TVEB4V.js:168:37\n at async Promise.all (index 0)\n at Inertia.#resolvePageProps (file:///node/app/beta-fullstack/build/node_modules/@adonisjs/inertia/build/chunk-W7TVEB4V.js:164:7)\n at Inertia.#buildPageObject (file:///node/app/beta-fullstack/build/node_modules/@adonisjs/inertia/build/chunk-W7TVEB4V.js:215:14)\n at Inertia.render (file:///node/app/beta-fullstack/build/node_modules/@adonisjs/inertia/build/chunk-W7TVEB4V.js:267:24)\n at HttpExceptionHandler.handle (file:///node/app/beta-fullstack/build/node_modules/@adonisjs/http-server/src/exception_handler.ts:356:34)" }, "msg": "Exception raised by error handler" }Beta Was this translation helpful? Give feedback.
All reactions