Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unused JSON superuser signup route #37378

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 0 additions & 7 deletions app/client/src/ce/api/UserApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,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 +213,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(
mohanarpit marked this conversation as resolved.
Show resolved Hide resolved
@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
sharat87 marked this conversation as resolved.
Show resolved Hide resolved

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
Loading