-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed as not planned
@cxue112
Description
Description
Hi Dev Team,
I spin up a gitea server and try to automatically create users with API, the response always containing the same problem:
{"message":"PasswordIsRequired","url":"http://<gitea-url>:<gitea-port>/api/swagger"}
My tries:
gitea server version: 1.24.2.
same token can list users, repos, create repos, but can not create users
- Request to create repo(worked):
curl -X 'POST' \
'http://<gitea-url>:<gitea-port>/api/v1/admin/users/<admin_user>/repos' \
-H 'accept: application/json' \
-H 'Authorization: token <token-created-by-admin>' \
-H 'Content-Type: application/json' \
-d '{
"name": "test_api"
}'
- Request to create user(NOT worked ):
curl -X 'POST' \
'http://<gitea-url>:<gitea-port>/api/v1/admin/users' \
-H 'accept: application/json' \
-H 'Authorization: token <token-created-by-admin>' \
-H 'Content-Type: application/json' \
-d '{
"email": "user1@example.com",
"full_name": "user1",
"login_name": "user1",
"must_change_password": false,
"password": "user1",
"restricted": false,
"visibility": "public",
"send_notify": false,
"username": "user1"
}'
Gitea Version
1.24.2
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
2025年08月08日 15:31:03 HTTPRequest [I] router: completed POST /api/v1/admin/users for xx.xxx.xxx.0:xxxxx, 400 Bad Request in 20.0ms @ admin/user.go:55(admin.CreateUser)
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
I followed the official page to deploy gitea on azure vm with docker compose via public ip
Database
PostgreSQL