Bind public methods to class instance#204
Merged
jonkoops merged 1 commit intokeycloak:mainfrom Nov 4, 2025
Merged
Conversation
Closes keycloak#202 Signed-off-by: Jon Koops <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
This PR converts public instance methods in the Keycloak class from traditional method syntax to arrow function class field syntax. This ensures that method references maintain proper this binding when passed as callbacks or used in contexts where they might lose their class instance context.
Key changes:
- Converted 15 public methods from traditional syntax to arrow function class fields
- Methods affected include
init,login,logout,register, and various token/user management methods - Private methods (prefixed with
#) remain unchanged with traditional method syntax
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Binds all public methods directly to the Keycloak instance using arrow function to prevent scoping issues. Although this would prevent binding public methods, which users might rely on (as a hack, nothing officially supported), this re-enables a much more widespread and common use-case to destructuring methods:
Closes #202