You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vine library errors are not displaying if make useAsyncLocalStorage: true
in config/app.js
If I make useAsyncLocalStorage: false
Vine errors are displaying.
But my requirement is to use HttpContext in my helper file. To use this HttpContext in helper I have to make useAsyncLocalStorage: false
How to resolve this?
Here is my code snippet:
// start/helper.ts
export async function hasPermission(user: User, permission: string): Promise<boolean> {
if (!user.id) {
return false // Ensure the user is logged in
}
const ctx = HttpContext.getOrFail() // I want to use HttpContext here
const session = ctx.session
const cachedPermissions = session.get(`permissions_${user.id}`)
if (cachedPermissions) {
return cachedPermissions.includes(permission)
}
}
Reproduction repo
No response
The text was updated successfully, but these errors were encountered:
Package version
Adonis Version: 6.17.0 and Vine Version: 3.0.0
Describe the bug
Vine library errors are not displaying if make
useAsyncLocalStorage: true
in config/app.js
If I make
useAsyncLocalStorage: false
Vine errors are displaying.
But my requirement is to use HttpContext in my helper file. To use this HttpContext in helper I have to make
useAsyncLocalStorage: false
How to resolve this?
Here is my code snippet:
Reproduction repo
No response
The text was updated successfully, but these errors were encountered: