mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
feat(setup): add a setup token for first-run setup (#3437)
This commit is contained in:
1 parent
8e39380ee6
commit
78272521bb
135 files changed
+3045
-771
No files matched your search
@@ -42,6 +42,9 @@ export const RegisterRequest = z.object({
|
||||
.nullish()
|
||||
.describe('Admin-issued registration URL code to use for this registration'),
|
||||
theme: RegisterThemeType.optional().describe('Initial UI theme preference for the new account'),
|
||||
setup_token: createStringType(1, 256)
|
||||
.nullish()
|
||||
.describe('Setup token of a new self-hosted instance. Required until the first admin account exists'),
|
||||
});
|
||||
|
||||
export type RegisterRequest = z.infer<typeof RegisterRequest>;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import {AccountIdentityModes, TagStyles} from '@fluxer/constants/src/AccountIdentityConstants';
|
||||
import {DomainMigrationDiscoveryResponse} from '@fluxer/schema/src/domains/admin/DomainMigrationSchemas';
|
||||
import {SsoStatusResponse} from '@fluxer/schema/src/domains/auth/AuthSchemas';
|
||||
import {createNamedStringLiteralUnion} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {createNamedStringLiteralUnion, createStringType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {z} from 'zod';
|
||||
|
||||
const LimitFilterResponse = z.object({
|
||||
@@ -56,6 +56,12 @@ export const InstanceSetupSchema = z
|
||||
.describe(
|
||||
'Present only while a self-hosted instance is unconfigured. True when the sign-in method can no longer change',
|
||||
),
|
||||
setup_token_required: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.describe(
|
||||
'Present only while a self-hosted instance is unconfigured. True when registration needs the setup token',
|
||||
),
|
||||
})
|
||||
.describe('Initial setup state for self-hosted instances');
|
||||
export type InstanceSetup = z.infer<typeof InstanceSetupSchema>;
|
||||
@@ -297,6 +303,9 @@ export const InstanceAccountIdentityUpdateRequest = z.object({
|
||||
tag_style: TagStyleSchema.optional().describe(
|
||||
'How usernames are tagged. Defaults to none. Username sign-in accepts only none',
|
||||
),
|
||||
setup_token: createStringType(1, 256)
|
||||
.nullish()
|
||||
.describe('Setup token of a new self-hosted instance. Required until the first admin account exists'),
|
||||
});
|
||||
|
||||
export type InstanceAccountIdentityUpdateRequest = z.infer<typeof InstanceAccountIdentityUpdateRequest>;
|
||||
|
||||
Reference in new issue
Block a user