#Login session problem

1 messages · Page 1 of 1 (latest)

native niche
#

user.js and Login component photos are Vue.js, the rest is laravel

#

Since i get 404 not found from users/me, i think the problem is the api (laravel/ backend)

amber oak
#

@native niche run php artisan route:list

native niche
#

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

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?

native niche
#

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

amber oak
#

okay i see an issue here

amber oak
native niche
#

yeah

amber oak
#

while you also defined it in a CustomUsersController which you expect here

#

can you check where it has been defined else?

native niche
#

ohh ive already changed that xd

#

i was just testing in a different controller

amber oak
#

okay, but the route definition is the same still?

native niche
#

yeah

amber oak
#

can you do php artisan route:clear and php artisan cache:clear

#

->middleware(...) is redundant here, as you defined it in the group

native niche
#

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

native niche
#

unfixable

#

cant understand

amber oak
#

so both commands just ran fine?

native niche
#

i thought it was the frontend but since im getting not found

native niche
amber oak
#

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

native niche
#

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)

amber oak
native niche
amber oak
native niche
#

im calling all my routes with api even the ones outside it

native niche
amber oak
#

ah sorry my bad, so this is inside api.php then?

native niche
amber oak
#

do you use some sort of container/vm?

native niche
#

im using sail, docker yeah

amber oak
#

okay so revert everything back to as it was

#

reboot docker completely

#

your code is fine

#

this is docker messing up

native niche
#

how is that possible?

#

are you saying to restart?

amber oak
#

docker caches things too

native niche
amber oak
#

i had docker F up things for me when it simply didnt work as intended

native niche
#

i restarted the containers

#

it did nothing

amber oak
#

what the heck lol

#

did you restart docker though

#

not just the containers

native niche
#

yeah, im going insane

#

ohh ok

scarlet condor
#
  • rebuild the container
native niche
native niche
#

gonna google it rn

#

haha

scarlet condor
#

I mean your container is build from an image.
Just delete the container and rebuild it

amber oak
#

@native niche do you have anything else on your system that uses docker

#

e.g. other projects

native niche
#

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

amber oak
#

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

native niche
#

its impossible

#

but every other endpoint works fine

amber oak
#

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

native niche
#

kinda stange that this one doesnt work

amber oak
native niche
#

omg

#

i only want to finish my project

amber oak
#

so basically, something clashes in your routing, its either routing itself or cache or docker

scarlet condor
#

Can't you just serve the app instead of running it within Docker ?

amber oak
#

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

native niche
#

the thing is im in a rush and wasting time with this sh..

amber oak
#

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

native niche
#

ok

#

do you rly believe thats the problem?

#

i might do it, but if it doesnt fix it

#

time sink

amber oak
#

well its one of the things that could be the issue

#

cannot guarantee 100%

native niche
#

ofc

amber oak
#

but from experience, docker screwed me over with that exact behaviour

#

especially on macos

native niche
#

what could be the other problems?

#

im on arch (endeavour)

amber oak
#

well cache or something in the code

#

but from what you shared, i couldnt see any issues in the code

native niche
#

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

native niche
#

@amber oak

#

its not docker

#

the npc that im working with is now online

#

and i asked to test it

#

he is using laragon, so

#

its not a docker problem

#

most likely code