diff --git a/app/client/src/ce/api/UserApi.tsx b/app/client/src/ce/api/UserApi.tsx index 82697968b445..bc3ec986d4ce 100644 --- a/app/client/src/ce/api/UserApi.tsx +++ b/app/client/src/ce/api/UserApi.tsx @@ -70,19 +70,6 @@ export interface SendTestEmailPayload { password?: string; } -export interface CreateSuperUserRequest { - email: string; - name: string; - source: "FORM"; - state: "ACTIVATED"; - isEnabled: boolean; - password: string; - role: "Developer"; - companyName: string; - allowCollectingAnonymousData: boolean; - signupForNewsletter: boolean; -} - export class UserApi extends Api { static usersURL = "v1/users"; static productAlertURL = "v1/product-alert/alert"; @@ -99,7 +86,6 @@ export class UserApi extends Api { static currentUserURL = "v1/users/me"; static photoURL = "v1/users/photo"; static featureFlagsURL = "v1/users/features"; - static superUserURL = "v1/users/super"; static adminSettingsURL = "v1/admin/env"; static restartServerURL = "v1/admin/restart"; static sendTestEmailURL = "/v1/admin/send-test-email"; @@ -214,12 +200,6 @@ export class UserApi extends Api { return Api.get(UserApi.featureFlagsURL); } - static async createSuperUser( - request: CreateSuperUserRequest, - ): Promise> { - return Api.post(UserApi.superUserURL, request); - } - /* * Super user endpoints */ diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java index 70c461dd732f..dcc6b6f7aaa1 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java @@ -9,7 +9,6 @@ import com.appsmith.server.dtos.ResetUserPasswordDTO; import com.appsmith.server.dtos.ResponseDTO; import com.appsmith.server.dtos.UserProfileDTO; -import com.appsmith.server.dtos.UserSignupRequestDTO; import com.appsmith.server.dtos.UserUpdateDTO; import com.appsmith.server.services.SessionUserService; import com.appsmith.server.services.UserDataService; @@ -70,19 +69,6 @@ public Mono createFormEncoded(ServerWebExchange exchange) { return userSignup.signupAndLoginFromFormData(exchange); } - @JsonView(Views.Public.class) - @PostMapping( - value = "/super", - consumes = {MediaType.APPLICATION_JSON_VALUE}) - public Mono> createSuperUser( - @Valid @RequestBody UserSignupRequestDTO resource, - @RequestHeader("Origin") String originHeader, - ServerWebExchange exchange) { - return userSignup - .signupAndLoginSuper(resource, originHeader, exchange) - .map(created -> new ResponseDTO<>(HttpStatus.CREATED.value(), created, null)); - } - @JsonView(Views.Public.class) @PostMapping( value = "/super", diff --git a/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh b/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh index 72acbe17a815..0bda58015f38 100644 --- a/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh +++ b/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh @@ -111,16 +111,13 @@ if [[ $status_code -eq 401 ]]; then default_user_name="${tokens[0]}" default_user_password="${tokens[1]}" - curl -k -X POST 'http://localhost/api/v1/users/super' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "name" : "'"$default_user_name"'", - "email" : "'"$default_user_name"'", - "source" : "FORM", - "state" : "ACTIVATED", - "isEnabled" : "true", - "password": "'"$default_user_password"'" - }' + curl http://localhost/api/v1/users/super \ + --data-urlencode "name=$default_user_name" \ + --data-urlencode "email=$default_user_name" \ + --data-urlencode "password=$default_user_password" \ + -d source=FORM \ + -d state=ACTIVATED \ + -d isEnabled=true curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ --header 'Content-Type: text/plain' \ diff --git a/deploy/aws_ami/first-time-setup.sh b/deploy/aws_ami/first-time-setup.sh index 1299e0915dec..32a714bf997b 100755 --- a/deploy/aws_ami/first-time-setup.sh +++ b/deploy/aws_ami/first-time-setup.sh @@ -110,16 +110,13 @@ if [[ $status_code -eq 401 ]]; then default_user_name="${tokens[0]}" default_user_password="${tokens[1]}" - curl -k -X POST 'http://localhost/api/v1/users/super' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "name" : "'"$default_user_name"'", - "email" : "'"$default_user_name"'", - "source" : "FORM", - "state" : "ACTIVATED", - "isEnabled" : "true", - "password": "'"$default_user_password"'" - }' + curl http://localhost/api/v1/users/super \ + --data-urlencode "name=$default_user_name" \ + --data-urlencode "email=$default_user_name" \ + --data-urlencode "password=$default_user_password" \ + -d source=FORM \ + -d state=ACTIVATED \ + -d isEnabled=true curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ --header 'Content-Type: text/plain' \