diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CreateUserPageController.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CreateUserPageController.java index b5a0200..3e54bf9 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CreateUserPageController.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CreateUserPageController.java @@ -19,7 +19,6 @@ public class CreateUserPageController extends BaseController { private FooterController footerController; @FXML private TextField firstNameField; - @FXML private TextField lastNameField; @FXML private TextField emailField; @FXML private PasswordField passwordField; @FXML private PasswordField confirmPasswordField; @@ -36,13 +35,12 @@ protected void authTokenisSet() { @FXML private void handleCreateAccount(ActionEvent event){ - String firstNameText = firstNameField.getText(); - String lastNameText = lastNameField.getText(); + String nameText = firstNameField.getText(); String emailText = emailField.getText(); String password = passwordField.getText(); String confirmPassword = confirmPasswordField.getText(); - if (firstNameText.isBlank() || lastNameText.isBlank() || emailText.isBlank() || password.isBlank() || confirmPassword.isBlank()) { + if (nameText.isBlank() || emailText.isBlank() || password.isBlank() || confirmPassword.isBlank()) { showAlert(Alert.AlertType.ERROR, "Empty input", "Please fill out all fields"); return; } @@ -60,8 +58,7 @@ private void handleCreateAccount(ActionEvent event){ // login boolean registerSuccess; try { - String username = firstNameText + " " + lastNameText; - registerSuccess = authToken.register(username,emailText, confirmPassword); + registerSuccess = authToken.register(nameText,emailText, confirmPassword); } catch (IllegalArgumentException e) { showAlert(Alert.AlertType.ERROR, "Email already taken", "Email already taken by another user."); return; @@ -76,7 +73,7 @@ private void handleCreateAccount(ActionEvent event){ Alert.AlertType.INFORMATION, "Sign up sucsess", "You have registered a new account! Please login with same credentials"); - LoaderScene.LoadScene("loginSite", event, null, null, authToken); + LoaderScene.LoadScene("profile_user_settings", event, null, null, authToken); } } diff --git a/helpmehelpapplication/src/main/resources/fxml/creater_user_site.fxml b/helpmehelpapplication/src/main/resources/fxml/creater_user_site.fxml index 946d979..670c659 100644 --- a/helpmehelpapplication/src/main/resources/fxml/creater_user_site.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/creater_user_site.fxml @@ -1,14 +1,11 @@ - - - @@ -20,11 +17,7 @@ - + @@ -40,13 +33,10 @@ - + - + @@ -64,14 +54,7 @@ - + @@ -83,7 +66,7 @@ - + @@ -97,31 +80,14 @@ - + - - - - - - - + @@ -134,11 +100,7 @@ - + @@ -149,11 +111,7 @@ - + @@ -164,23 +122,13 @@ - + -