auth()->attempt() caching? or remembering user on integration tests #203
Unanswered
bruno-braga
asked this question in
Q&A
Replies: 1 comment
-
Need more details to help you out. |
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
-
I'm doing some integration test in my application and I stumble in a problem.
Everytime that I hit the login endpoing of my application - my auth controller is the same as the one in the docs - it seems that the user is being remember some how by auth()->attempt() not allowing me to test, for instance, if my endpoint will return an 401 because as the user is being remembered the requests are always passing though.
This is only happening at the test level my front end is working fine.
One thing I tried to solve this issue was to pass a second boolean param to attempt that is called "remember" which breaks all my test because with that param auth()->attempt returns only a boolean instead of an object with the token.
anybody with a use case like this??
thanks in advance for the help :)
Beta Was this translation helpful? Give feedback.
All reactions