Skip to content

Commit 4d027a4

Browse files
committed
Implement Pomelo Registration
1 parent 0756932 commit 4d027a4

File tree

11 files changed

+1835
-2249
lines changed

11 files changed

+1835
-2249
lines changed

Diff for: assets/locales/en/auth.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
1616
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another",
1717
"GUESTS_DISABLED": "Guest users are disabled",
18-
"TOO_MANY_REGISTRATIONS": "Too many registrations, please try again later"
18+
"TOO_MANY_REGISTRATIONS": "Too many registrations, please try again later",
19+
"UNIQUE_USERNAMES_DISABLED": "The Unique Usernames feature is disabled on this instance"
1920
},
2021
"password_reset": {
2122
"EMAIL_DOES_NOT_EXIST": "Email does not exist.",

Diff for: assets/openapi.json

+138-75
Original file line numberDiff line numberDiff line change
@@ -3499,9 +3499,6 @@
34993499
"global_name": {
35003500
"type": "string"
35013501
},
3502-
"legacy_username": {
3503-
"type": "string"
3504-
},
35053502
"discriminator": {
35063503
"type": "string"
35073504
},
@@ -6014,6 +6011,17 @@
60146011
}
60156012
}
60166013
},
6014+
"UsernameAttemptUnauthedSchema": {
6015+
"type": "object",
6016+
"properties": {
6017+
"username": {
6018+
"type": "string"
6019+
}
6020+
},
6021+
"required": [
6022+
"username"
6023+
]
6024+
},
60176025
"VanityUrlSchema": {
60186026
"type": "object",
60196027
"properties": {
@@ -7040,9 +7048,6 @@
70407048
"global_name": {
70417049
"type": "string"
70427050
},
7043-
"legacy_username": {
7044-
"type": "string"
7045-
},
70467051
"discriminator": {
70477052
"type": "string"
70487053
},
@@ -7163,9 +7168,6 @@
71637168
"global_name": {
71647169
"type": "string"
71657170
},
7166-
"legacy_username": {
7167-
"type": "string"
7168-
},
71697171
"discriminator": {
71707172
"type": "string"
71717173
},
@@ -8025,6 +8027,17 @@
80258027
"days"
80268028
]
80278029
},
8030+
"UsernameAttemptResponse": {
8031+
"type": "object",
8032+
"properties": {
8033+
"taken": {
8034+
"type": "boolean"
8035+
}
8036+
},
8037+
"required": [
8038+
"taken"
8039+
]
8040+
},
80288041
"VerifyEmailSchema": {
80298042
"type": "object",
80308043
"properties": {
@@ -8130,6 +8143,9 @@
81308143
{
81318144
"name": "track"
81328145
},
8146+
{
8147+
"name": "unique-username"
8148+
},
81338149
{
81348150
"name": "updates"
81358151
},
@@ -9775,6 +9791,85 @@
97759791
]
97769792
}
97779793
},
9794+
"/unique-username/username-suggestions-unauthed/": {
9795+
"get": {
9796+
"security": [
9797+
{
9798+
"bearer": []
9799+
}
9800+
],
9801+
"responses": {
9802+
"400": {
9803+
"description": "",
9804+
"content": {
9805+
"application/json": {
9806+
"schema": {
9807+
"$ref": "#/components/schemas/APIErrorResponse"
9808+
}
9809+
}
9810+
}
9811+
}
9812+
},
9813+
"parameters": [
9814+
{
9815+
"name": "global_name",
9816+
"in": "query",
9817+
"required": false,
9818+
"schema": {
9819+
"type": "string"
9820+
}
9821+
}
9822+
],
9823+
"tags": [
9824+
"unique-username"
9825+
]
9826+
}
9827+
},
9828+
"/unique-username/username-attempt-unauthed/": {
9829+
"post": {
9830+
"security": [
9831+
{
9832+
"bearer": []
9833+
}
9834+
],
9835+
"description": "Check if a username is available",
9836+
"requestBody": {
9837+
"required": true,
9838+
"content": {
9839+
"application/json": {
9840+
"schema": {
9841+
"$ref": "#/components/schemas/UsernameAttemptUnauthedSchema"
9842+
}
9843+
}
9844+
}
9845+
},
9846+
"responses": {
9847+
"200": {
9848+
"description": "",
9849+
"content": {
9850+
"application/json": {
9851+
"schema": {
9852+
"$ref": "#/components/schemas/UsernameAttemptResponse"
9853+
}
9854+
}
9855+
}
9856+
},
9857+
"400": {
9858+
"description": "",
9859+
"content": {
9860+
"application/json": {
9861+
"schema": {
9862+
"$ref": "#/components/schemas/APIErrorResponse"
9863+
}
9864+
}
9865+
}
9866+
}
9867+
},
9868+
"tags": [
9869+
"unique-username"
9870+
]
9871+
}
9872+
},
97789873
"/track/": {
97799874
"post": {
97809875
"responses": {
@@ -10290,6 +10385,15 @@
1029010385
}
1029110386
}
1029210387
},
10388+
"parameters": [
10389+
{
10390+
"name": "client_id",
10391+
"in": "query",
10392+
"schema": {
10393+
"type": "string"
10394+
}
10395+
}
10396+
],
1029310397
"tags": [
1029410398
"oauth2"
1029510399
]
@@ -10366,6 +10470,30 @@
1036610470
]
1036710471
}
1036810472
},
10473+
"/oauth2/applications/@me/": {
10474+
"get": {
10475+
"security": [
10476+
{
10477+
"bearer": []
10478+
}
10479+
],
10480+
"responses": {
10481+
"200": {
10482+
"description": "",
10483+
"content": {
10484+
"application/json": {
10485+
"schema": {
10486+
"$ref": "#/components/schemas/Application"
10487+
}
10488+
}
10489+
}
10490+
}
10491+
},
10492+
"tags": [
10493+
"oauth2"
10494+
]
10495+
}
10496+
},
1036910497
"/invites/{code}": {
1037010498
"get": {
1037110499
"security": [
@@ -13995,71 +14123,6 @@
1399514123
]
1399614124
}
1399714125
},
13998-
"/guilds/{guild_id}/bans/@me": {
13999-
"put": {
14000-
"security": [
14001-
{
14002-
"bearer": []
14003-
}
14004-
],
14005-
"requestBody": {
14006-
"required": true,
14007-
"content": {
14008-
"application/json": {
14009-
"schema": {
14010-
"$ref": "#/components/schemas/BanCreateSchema"
14011-
}
14012-
}
14013-
}
14014-
},
14015-
"responses": {
14016-
"200": {
14017-
"description": "",
14018-
"content": {
14019-
"application/json": {
14020-
"schema": {
14021-
"$ref": "#/components/schemas/Ban"
14022-
}
14023-
}
14024-
}
14025-
},
14026-
"400": {
14027-
"description": "",
14028-
"content": {
14029-
"application/json": {
14030-
"schema": {
14031-
"$ref": "#/components/schemas/APIErrorResponse"
14032-
}
14033-
}
14034-
}
14035-
},
14036-
"403": {
14037-
"description": "",
14038-
"content": {
14039-
"application/json": {
14040-
"schema": {
14041-
"$ref": "#/components/schemas/APIErrorResponse"
14042-
}
14043-
}
14044-
}
14045-
}
14046-
},
14047-
"parameters": [
14048-
{
14049-
"name": "guild_id",
14050-
"in": "path",
14051-
"required": true,
14052-
"schema": {
14053-
"type": "string"
14054-
},
14055-
"description": "guild_id"
14056-
}
14057-
],
14058-
"tags": [
14059-
"guilds"
14060-
]
14061-
}
14062-
},
1406314126
"/guilds/{guild_id}/audit-logs/": {
1406414127
"get": {
1406514128
"security": [
@@ -16408,7 +16471,7 @@
1640816471
},
1640916472
"/auth/generate-registration-tokens/": {
1641016473
"get": {
16411-
"x-right-required": "OPERATOR",
16474+
"x-right-required": "CREATE_REGISTRATION_TOKENS",
1641216475
"security": [
1641316476
{
1641416477
"bearer": []

0 commit comments

Comments
 (0)