GUACAMOLE-540: Clean up Credentials with new constructor.

This commit is contained in:
Nick Couchman committed 2018-06-16 08:06:07 -04:00
1 parent c725da00a0
commit 52a3f454e6
4 files changed
+44 -29

No files matched your search

@@ -55,7 +55,7 @@ public class TokenRESTService {
* Logger for this class.
*/
private static final Logger logger = LoggerFactory.getLogger(TokenRESTService.class);
/**
* Service for authenticating users and managing their Guacamole sessions.
*/
@@ -117,13 +117,7 @@ public class TokenRESTService {
} // end Authorization header fallback
// Build credentials
Credentials credentials = new Credentials();
credentials.setUsername(username);
credentials.setPassword(password);
credentials.setRequest(request);
credentials.setSession(request.getSession(false));
return credentials;
return new Credentials(username, password, request);
}
@@ -155,11 +155,8 @@ public class UserResource
@Context HttpServletRequest request) throws GuacamoleException {
// Build credentials
Credentials credentials = new Credentials();
credentials.setUsername(user.getIdentifier());
credentials.setPassword(userPasswordUpdate.getOldPassword());
credentials.setRequest(request);
credentials.setSession(request.getSession(false));
Credentials credentials = new Credentials(user.getIdentifier(),
userPasswordUpdate.getOldPassword(), request);
// Verify that the old password was correct
try {