Expose the invite URL and the pinned username and email in the admin API

Registration tokens now report the `/register?token=…` deep link alongside the
`username` and `email` they were issued for, and the create endpoint accepts
both. All the token endpoints now take the `UrlBuilder` so they can build that
link, and `Register` carries the token in its query string.
This commit is contained in:
Quentin Gliech committed 2026-10-13 14:02:33 +02:00
1 parent e08fa11467
commit 7cdf85e279
11 files changed
+383 -82

No files matched your search

+49 -8
View File
@@ -3797,12 +3797,15 @@
"attributes": {
"token": "abc123def456",
"valid": true,
"username": null,
"email": null,
"usage_limit": 10,
"times_used": 5,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": "1970-01-01T00:00:00Z",
"expires_at": "1970-01-31T00:00:00Z",
"revoked_at": null
"revoked_at": null,
"invite_url": "https://example.com/register?token=abc123def456"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/01040G2081040G2081040G2081"
@@ -3819,12 +3822,15 @@
"attributes": {
"token": "xyz789abc012",
"valid": false,
"username": null,
"email": null,
"usage_limit": null,
"times_used": 0,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": null,
"expires_at": null,
"revoked_at": "1970-01-01T00:00:00Z"
"revoked_at": "1970-01-01T00:00:00Z",
"invite_url": "https://example.com/register?token=xyz789abc012"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/02081040G2081040G2081040G2"
@@ -3879,12 +3885,15 @@
"attributes": {
"token": "abc123def456",
"valid": true,
"username": null,
"email": null,
"usage_limit": 10,
"times_used": 5,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": "1970-01-01T00:00:00Z",
"expires_at": "1970-01-31T00:00:00Z",
"revoked_at": null
"revoked_at": null,
"invite_url": "https://example.com/register?token=abc123def456"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/01040G2081040G2081040G2081"
@@ -3934,12 +3943,15 @@
"attributes": {
"token": "abc123def456",
"valid": true,
"username": null,
"email": null,
"usage_limit": 10,
"times_used": 5,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": "1970-01-01T00:00:00Z",
"expires_at": "1970-01-31T00:00:00Z",
"revoked_at": null
"revoked_at": null,
"invite_url": "https://example.com/register?token=abc123def456"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/01040G2081040G2081040G2081"
@@ -4015,12 +4027,15 @@
"attributes": {
"token": "abc123def456",
"valid": true,
"username": null,
"email": null,
"usage_limit": 10,
"times_used": 5,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": "1970-01-01T00:00:00Z",
"expires_at": "1970-01-31T00:00:00Z",
"revoked_at": null
"revoked_at": null,
"invite_url": "https://example.com/register?token=abc123def456"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/01040G2081040G2081040G2081"
@@ -4088,12 +4103,15 @@
"attributes": {
"token": "xyz789abc012",
"valid": false,
"username": null,
"email": null,
"usage_limit": null,
"times_used": 0,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": null,
"expires_at": null,
"revoked_at": "1970-01-01T00:00:00Z"
"revoked_at": "1970-01-01T00:00:00Z",
"invite_url": "https://example.com/register?token=xyz789abc012"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/02081040G2081040G2081040G2"
@@ -4178,12 +4196,15 @@
"attributes": {
"token": "abc123def456",
"valid": true,
"username": null,
"email": null,
"usage_limit": 10,
"times_used": 5,
"created_at": "1970-01-01T00:00:00Z",
"last_used_at": "1970-01-01T00:00:00Z",
"expires_at": "1970-01-31T00:00:00Z",
"revoked_at": null
"revoked_at": null,
"invite_url": "https://example.com/register?token=abc123def456"
},
"links": {
"self": "/api/admin/v1/user-registration-tokens/01040G2081040G2081040G2081"
@@ -7310,6 +7331,20 @@
"description": "Whether the token is valid",
"type": "boolean"
},
"username": {
"description": "A username imposed on the registering user. If null, the user can\nchoose their own username.",
"type": [
"string",
"null"
]
},
"email": {
"description": "An email address imposed on the registering user. If null, the user\ncan choose their own email.",
"type": [
"string",
"null"
]
},
"usage_limit": {
"description": "Maximum number of times this token can be used",
"type": [
@@ -7353,13 +7388,19 @@
"null"
],
"format": "date-time"
},
"invite_url": {
"description": "URL to share with the user to register with this token",
"type": "string",
"format": "uri"
}
},
"required": [
"token",
"valid",
"times_used",
"created_at"
"created_at",
"invite_url"
]
},
"AddUserRegistrationTokenRequest": {