leepeuker / movary

Self hosted web app to track and rate your watched movies
MIT License
388 stars 14 forks source link

[Bug] Can't log in after upgrading to 1815eb87 from a367d204 #600

Closed Davilarek closed 1 month ago

Davilarek commented 5 months ago

Description

After upgrading to 1815eb87 from a367d204, I'm unable to log into my main account. The login page just refreshes. After using network tab of DevTools I was able to find a failing request to token auth.

Version

Commit 1815eb87

Steps to Reproduce

  1. Upgrade to 1815eb8 from a367d204
  2. Migrate
  3. Try to log in
  4. See unable to do so
  5. Check out browser console and network tab
  6. Observe error

Screenshots

obraz Failed request obraz

Logs

Warning: session_destroy(): Trying to destroy uninitialized session in /home/davil/AUR/movary/src/Util/SessionWrapper.php on line 32

Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in /home/davil/AUR/movary/src/Util/SessionWrapper.php on line 33

Warning: session_start(): Session cannot be started after headers have already been sent in /home/davil/AUR/movary/src/Util/SessionWrapper.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home/davil/AUR/movary/src/Util/SessionWrapper.php:32) in /home/davil/AUR/movary/src/Domain/User/Service/Authentication.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /home/davil/AUR/movary/src/Util/SessionWrapper.php:32) in /home/davil/AUR/movary/public/index.php on line 65

Warning: Cannot modify header information - headers already sent by (output started at /home/davil/AUR/movary/src/Util/SessionWrapper.php:32) in /home/davil/AUR/movary/public/index.php on line 67
{"authToken":"<REDACTED>","user":{"id":1,"name":"Davilarek","isAdmin":true}}

Server OS

Arch Linux

Client Platform

Desktop

Client Device

No response

Client OS

Arch Linux

Client Browser

Firefox

Additional Context

No response

leepeuker commented 5 months ago

Hey, thanks for reporting your issue.

Could you please try again with the lastest main branch (1815eb8) and verify if the issue persists?

Davilarek commented 5 months ago

What do you mean? In the issue I mentioned I upgraded from a367d20 to latest (1815eb8)

leepeuker commented 5 months ago

Oh my bad, you are right, seems like I missed something there :+1:

JVT038 commented 5 months ago

This error is probably caused because the session doesn't start upon loading the page for some reason.

After some digging, I found that the session should be started by the middleware that's added here. Could you check if your src/Service/Router/RouterService.php has the same code and that it also adds the StartSession::class middleware on line 16?

Maybe you've changed something locally or the middleware doesn't run on your machine for whatever reason.

Davilarek commented 5 months ago

obraz src/Service/Router/RouterService.php is unmodified.

leepeuker commented 4 months ago

@Davilarek Sorry it seems like I forgot about this issue. Is this still happening/relevant?

Davilarek commented 4 months ago

Correct

Davilarek commented 4 months ago

Also this may be useful: obraz It's one of the error-making requests' header.

leepeuker commented 1 month ago

Thank you @Davilarek for providing a fix 🏅