Fix A logged in user is required to resolve the authorization request (500 error) #1839
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using Interstellar I was trying to relogin on my kbin.melroy.org. However, I was faced with an Internal Server Error (500 server error coming from
oauth2-server-bundle) 😢 .Logging said:
{"message":"Uncaught PHP Exception RuntimeException: \"A logged in user is required to resolve the authorization request.\" at AuthorizationRequestResolveEventFactoryTrait.php line 44","context":{"exception":{"class":"RuntimeException","message":"A logged in user is required to resolve the authorization request.","code":0,"file":"/var/www/kbin.melroy.org/html/vendor/league/oauth2-server-bundle/src/Event/AuthorizationRequestResolveEventFactoryTrait.php:44"}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2025-11-16T21:00:13.914366+01:00","extra":{}}So, I followed the documentation instructions: https://github.com/thephpleague/oauth2-server-bundle/blob/44272ff229da25305d4f5612546851bbcaa72d9a/docs/index.md?plain=1#L149
(Related PR: thephpleague/oauth2-server-bundle#200)
I tested it.. And this PR fixes the issue I was having on my kbin.melroy.org with Interstellar and an expired login session I guess.
This will maybe also fix the session issues with people that are getting logged-out?