mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
chore: improve password error message (#6255)
chore: improve error message chore: add password minlength & maxlength i18n chore: check max length fix: i18n variables feat: add CredentialsRequirementType
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { ServerFeature } from '@affine/graphql';
|
||||
import type { ServerConfigQuery, ServerFeature } from '@affine/graphql';
|
||||
import { oauthProvidersQuery, serverConfigQuery } from '@affine/graphql';
|
||||
import type { BareFetcher, Middleware } from 'swr';
|
||||
|
||||
@@ -73,3 +73,13 @@ export const useServerBaseUrl = () => {
|
||||
|
||||
return config.baseUrl;
|
||||
};
|
||||
|
||||
export const useCredentialsRequirement = () => {
|
||||
const config = useServerConfig();
|
||||
|
||||
if (!config) {
|
||||
return {} as ServerConfigQuery['serverConfig']['credentialsRequirement'];
|
||||
}
|
||||
|
||||
return config.credentialsRequirement;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user