#Login session problem
1 messages · Page 1 of 1 (latest)
Since i get 404 not found from users/me, i think the problem is the api (laravel/ backend)
@native niche run php artisan route:list
i has been 3hours and im wasting my time with this
cant fix it
literally got randomly logged out while i was doing other stuff
and after that, login stopped working without changing code
it doesnt make sense
@amber oak
404 is a different/unrelated error to auth, and i am confused why it gives 404 when it actually is right there
can you try with postman/other to hit that endpoint?
yeah it doesnt work as well
login works jsut fine
users/me nothing
i literally started learning laravel a week ago and vue 2 days ago
ive got 1 week and my team project gave up
this project was meant for 4
everything going as planned
im so stressed and annoyed
okay i see an issue here
here it says UserController
yeah
while you also defined it in a CustomUsersController which you expect here
can you check where it has been defined else?
okay, but the route definition is the same still?
can you do php artisan route:clear and php artisan cache:clear
->middleware(...) is redundant here, as you defined it in the group
the entire api is almost done, but middleware stuff isnt finished
permissions etc
i still need to figured that out
i just started doing the frontend without that cuz im super late
it did nothing
unfixable
cant understand
so both commands just ran fine?
i thought it was the frontend but since im getting not found
inside your current controller for that route
simply do return 'ok'; as a test
after that, try moving the route outside the auth:api group and call it with domain.com/users/me
now im going to try to put that route outside auth:api group and call it
nothing
this is not normal
this should be a basic thing (login/logout)
you had /api/ there still
what is the status? it is cut off
im calling all my routes with api even the ones outside it
404 not found
ah sorry my bad, so this is inside api.php then?
yeah
do you use some sort of container/vm?
im using sail, docker yeah
okay so revert everything back to as it was
reboot docker completely
your code is fine
this is docker messing up
docker caches things too
i had docker F up things for me when it simply didnt work as intended
- rebuild the container
still nothing
rebuild? idek how to do that
gonna google it rn
haha
I mean your container is build from an image.
Just delete the container and rebuild it
@native niche do you have anything else on your system that uses docker
e.g. other projects
yeah, but i only have one project with "sail up"
do you rly think that this problem is that deep?
ive got a guy that were "programming" and he got a similiar problem
but he doesnt give a shiot about this so idk
but i think he just db:seed or migrate:fresh
and it fixed
but kinda strange if the code is fine
laravel gettin this kinda problems in so small space of time
well this is on a routing level and not db level, so the seed/fresh command wont do anything
i personally have a hefty bias against sail, so my opinion on that i'll exclude
however its not only sail but docker creating issues, i was asking this as there is a potenial ⁄destructive command, to clean up docker completely to get a fresh start
kinda stange that this one doesnt work
its not laravel btw :p
so basically, something clashes in your routing, its either routing itself or cache or docker
Can't you just serve the app instead of running it within Docker ?
there is a command you could run, but be aware this deletes all containers, images networks other docker related things - this gives you a fresh start, you just need to run sail up or something to get it started again, perhaps you need to check the sail docs to boot up everything
if you want to cleanup docker, run this in a terminal, it will show you what will be deleted, it is a safe command but prunes docker - you need to stop your containers for them to be cleaned up: docker system prune -a
i might try that
the thing is im in a rush and wasting time with this sh..
the command itself is no harm, just if you have X docker projects, you also are destroying their containers and data
e.g. if you have a database container, these containers and volumes would be gone too
just so you know
ok
do you rly believe thats the problem?
i might do it, but if it doesnt fix it
time sink
ofc
but from experience, docker screwed me over with that exact behaviour
especially on macos
well cache or something in the code
but from what you shared, i couldnt see any issues in the code
idek what im going to do
its 8am in here
and i did almost nothing today due to this
i expected to do a lot of stuff
and time passes
i dont want to fail this class
...
idk if i will "remove" the login
just so i can move on
and then think about this
but yeah login is like a must to test stuff
ahhhhh