mirror of
https://github.com/zoriya/flood.git
synced 2026-06-05 11:49:24 +00:00
API: auth: preload server configs along with /verify response
Get rid of last build-time config dependency and allows easier switching of client modes.
This commit is contained in:
@@ -23,8 +23,14 @@ export type AuthRegistrationOptions = Required<z.infer<typeof authRegistrationSc
|
||||
export const authUpdateUserSchema = credentialsSchema.partial();
|
||||
export type AuthUpdateUserOptions = z.infer<typeof authUpdateUserSchema>;
|
||||
|
||||
// GET /api/auth/verify - preload configurations
|
||||
export interface AuthVerificationPreloadConfigs {
|
||||
disableAuth: boolean;
|
||||
pollInterval: number;
|
||||
}
|
||||
|
||||
// GET /api/auth/verify - success response
|
||||
export type AuthVerificationResponse =
|
||||
export type AuthVerificationResponse = (
|
||||
| {
|
||||
initialUser: true;
|
||||
}
|
||||
@@ -32,5 +38,7 @@ export type AuthVerificationResponse =
|
||||
initialUser: false;
|
||||
username: string;
|
||||
level: AccessLevel;
|
||||
token?: string;
|
||||
};
|
||||
}
|
||||
) & {
|
||||
configs: AuthVerificationPreloadConfigs;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user