Github user ceharris commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/197#discussion_r145804691
--- Diff:
guacamole-ext/src/main/java/org/apache/guacamole/net/event/AuthenticationSuccessEvent.java
---
@@ -43,19 +44,19 @@
/**
* The credentials which passed authentication.
*/
- private Credentials credentials;
+ private AuthenticatedUser authenticatedUser;
/**
* Creates a new AuthenticationSuccessEvent which represents a
successful
* authentication attempt with the given credentials.
*
* @param context The UserContext created as a result of successful
* authentication.
- * @param credentials The credentials which passed authentication.
+ * @param authenticatedUser The user which passed authentication.
*/
- public AuthenticationSuccessEvent(UserContext context, Credentials
credentials) {
+ public AuthenticationSuccessEvent(UserContext context,
AuthenticatedUser authenticatedUser) {
--- End diff --
You could drop `UserContext` in the constructor here and drop the
associated field. Then you could implement `getUserContext` as:
```
public UserContext getUserContext() {
return
authenticatedUser.getAuthenticationProvider().getUserContext(authenticatedUser);
}
```
This will avoid the need to handle the exception for the missing
userContext when the event object is created.
---