Comments (7)
Hey @Moumouuu! 👋🏻
Have you added the authApiClient
plugin to Japa and activated the memory
driver for the session store when testing as per our documentation?
Also, you must use the Session
module when using the Session Guard
from core.
Thank you for the quick response!
Could you please clarify what you meant by 'added the authApiClient plugin to Japa and activated the memory driver for the session store'?
As shown in my screenshot, I included the authApiClient in the plugins section of bootstrap.ts, and in .env.test, I configured 'SESSION_DRIVER=memory'. Additionally, I'm utilizing Session and Session Guard.
I'm really following the documentation closely..
from core.
unfortunately i'm facing the exact same issue, following the doc guidelines for auth testing but cannot resolve it with ease. I already verified that before each test the SESSION_DRIVER is set to memory using env.get("SESSION_DRIVER"), added authApiClient in test/bootstrap.ts
file as a plugin, and using the loginAs func to provide a authenticated session. But, as far as I understand, the client
used in my test has type ApiClient, not authApiClient, might this be the cause of the TypeError thrown ?
from core.
It seems that your reproduction is not updated. Could you please push your latest version @Moumouuu?
Could you also try to change the loading order of the Japa plugins and put the authApiClient
plugin at the end.
from core.
I pushed my modifications and also added authApiClient at the end, but no changes occurred.
On this branch : https://github.com/Avocado-Community/api.avocadogrowth/tree/11-dev-logout
from core.
You are also missing the sessionApiClient
. I highly recommend reading the docs carefully, since all this is covered in docs very clearly.
from core.
Thanks for the answer !
I highly recommend reading the docs carefully, since all this is covered in docs very clearly.
Since the two of us followed very carefully the docs, but did not found the right command or plugin to use, I may recommend to detail the two cases in the doc, separating specs required for auth testing with session and those for auth testing without session, it was very unclear for us that the authApiClient did not handle that itslef.
Anyway, I think a complete minimum working example would greatly enhance the documentation for these particular cases.
Thanks again !
from core.
Related Issues (20)
- `build` command fails when paths are passed via `--assets-args` HOT 1
- Getting error in Singleton import
- Problem Generating Routes with Router.builder in Imported Routes HOT 1
- unable to determine transport target for "pino-pretty"
- i cant use String for accessTokens id HOT 2
- Healthcheck HOT 2
- Adonis 6 migration with 'uuid' as primary key HOT 3
- The data obtained by the get parameter is incorrect
- Pluralization is broken HOT 6
- Issue when inertia build with example code HOT 1
- Error install dependencies new project core 6.6.0 HOT 2
- npm init adonis-ts-app@latest app-name error if eslint paramenter is set to true HOT 3
- Adonis js doesnt look filename with extension, build ERROR HOT 1
- Incomplete project structure HOT 1
- Bullmq Worker not reusing configured active redis connection
- ENOSPC: System limit for number of file watchers reached, from `yarn dev` HOT 6
- Kit doesn't taken in count by creating a new project with a project name HOT 3
- Adonis mail + node ace commands don't work HOT 3
- Support for yarn@berry HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.