Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions app/client/src/ce/api/UserApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -214,12 +200,6 @@ export class UserApi extends Api {
return Api.get(UserApi.featureFlagsURL);
}

static async createSuperUser(
request: CreateSuperUserRequest,
): Promise<AxiosPromise<CreateUserResponse>> {
return Api.post(UserApi.superUserURL, request);
}

/*
* Super user endpoints
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,19 +69,6 @@ public Mono<Void> createFormEncoded(ServerWebExchange exchange) {
return userSignup.signupAndLoginFromFormData(exchange);
}

@JsonView(Views.Public.class)
@PostMapping(
value = "/super",
consumes = {MediaType.APPLICATION_JSON_VALUE})
public Mono<ResponseDTO<User>> 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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
17 changes: 7 additions & 10 deletions deploy/aws_ami/first-time-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down