-
Notifications
You must be signed in to change notification settings - Fork 189
fix: Handle translation requests when session is expired #23239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Handle translation requests when session is expired #23239
Conversation
|
What is the session used for in the handler? |
|
Apparently it is not used at all, but there is no way to have a request handler that does not care about the session? |
|
Exactly. Request Handlers are invoked after the attempt to create/get a Vaadin session is already done. |
| @Override | ||
| public boolean synchronizedHandleRequest(VaadinSession session, | ||
| VaadinRequest request, VaadinResponse response) throws IOException { | ||
| handleTranslationRequest(session.getService(), request, response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be request.getService() instead to be clear that the session is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| @Override | ||
| public boolean handleSessionExpired(VaadinRequest request, | ||
| VaadinResponse response) throws IOException { | ||
| if (!canHandleRequest(request)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Somehow this looks inverted to me when it could be "if we can handle, handle it, otherwise don't"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update
Implement SessionExpiredHandler in TranslationFileRequestHandler to serve translations even when no active session exists. This allows i18n requests to work correctly with stateless authentication. Fixes #23238
dedacc9 to
8c1382e
Compare
|



Implement SessionExpiredHandler in TranslationFileRequestHandler to serve translations even when no active session exists. This allows i18n requests to work correctly with stateless authentication.
Fixes #23238