No need to create Map if user not valid.

This commit is contained in:
Michael Jumper
2011-12-21 00:09:51 -08:00
parent 19fe9dcc9b
commit 532bbbd107

View File

@@ -133,11 +133,10 @@ public class BasicFileAuthenticationProvider implements AuthenticationProvider<U
if (mapping == null)
throw new GuacamoleException("User mapping could not be read.");
Map<String, GuacamoleConfiguration> configs = new HashMap<String, GuacamoleConfiguration>();
// Validate and return info for given user and pass
AuthInfo info = mapping.get(credentials.getUsername());
if (info != null && info.validate(credentials.getUsername(), credentials.getPassword())) {
Map<String, GuacamoleConfiguration> configs = new HashMap<String, GuacamoleConfiguration>();
configs.put("DEFAULT", info.getConfiguration());
return configs;
}