Search in sources :

Example 6 with Authentication

use of kml.auth.Authentication in project Krothium-Launcher by DarkLBP.

the class MainFX method logout.

/**
 * Logs out the selected user from the existing user list
 */
public final void logout() {
    User selected = existingUsers.getSelectionModel().getSelectedItem();
    int result = kernel.showAlert(Alert.AlertType.CONFIRMATION, null, Language.get(8));
    if (result == 1) {
        Authentication auth = kernel.getAuthentication();
        auth.removeUser(selected);
        kernel.saveProfiles();
        updateExistingUsers();
    }
}
Also used : User(kml.auth.user.User) Authentication(kml.auth.Authentication)

Aggregations

Authentication (kml.auth.Authentication)6 User (kml.auth.user.User)5 AuthenticationException (kml.exceptions.AuthenticationException)2 URISyntaxException (java.net.URISyntaxException)1 FXML (javafx.fxml.FXML)1 FXMLLoader (javafx.fxml.FXMLLoader)1 Parent (javafx.scene.Parent)1 Scene (javafx.scene.Scene)1 Stage (javafx.stage.Stage)1 GameLauncherException (kml.exceptions.GameLauncherException)1 Profile (kml.game.profile.Profile)1 Version (kml.game.version.Version)1 VersionMeta (kml.game.version.VersionMeta)1 Versions (kml.game.version.Versions)1 AssetIndex (kml.game.version.asset.AssetIndex)1 Library (kml.game.version.library.Library)1 JSONObject (org.json.JSONObject)1