Skip to content

Commit

Permalink
fix implmenation in case of plugins absence
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Mar 22, 2024
1 parent 6f73037 commit 96aaf2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/studio/core/AuthenticationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ public synchronized static AuthenticationManager getInstance() {
}

private void init() {
loadPlugins();

List<String> auths = new ArrayList<>(classMap.keySet());
auths.remove(DefaultAuthenticationMechanism.NAME);
Collections.sort(auths);
auths.add(0, DefaultAuthenticationMechanism.NAME);
authMechanisms = auths.toArray(new String[0]);
}

private AuthenticationManager() {

private void loadPlugins() {
DefaultAuthenticationMechanism dam = new DefaultAuthenticationMechanism();
classMap.put(dam.getMechanismName(),dam.getClass());

Expand Down Expand Up @@ -92,7 +95,9 @@ private AuthenticationManager() {
log.error("Error loading plugin {}", filename, e);
}
}
}

private AuthenticationManager() {
init();
}
}

0 comments on commit 96aaf2d

Please sign in to comment.