Ajoute le flux d'invitation avec activation de compte
This commit is contained in:
Vendored
+46
-1
@@ -30,6 +30,16 @@ type PasswordResetTokenState = {
|
||||
email: string;
|
||||
mode: PasswordResetMode;
|
||||
};
|
||||
type AccountInviteTokenState = {
|
||||
status: "loading";
|
||||
} | {
|
||||
status: "invalid";
|
||||
error: string;
|
||||
} | {
|
||||
status: "valid";
|
||||
email: string;
|
||||
name: string | null;
|
||||
};
|
||||
|
||||
type CreateAuthClientOptions = {
|
||||
apiUrl: (path: string) => string;
|
||||
@@ -59,10 +69,45 @@ declare function createAuthClient(options: CreateAuthClientOptions): {
|
||||
token: string;
|
||||
password: string;
|
||||
}): Promise<void>;
|
||||
validateAccountInviteToken(token: string): Promise<{
|
||||
email: string;
|
||||
name: string | null;
|
||||
}>;
|
||||
acceptAccountInvite(input: {
|
||||
token: string;
|
||||
name: string;
|
||||
password: string;
|
||||
}): Promise<void>;
|
||||
logout(): Promise<void>;
|
||||
startOAuthSignIn(provider: string, callbackUrl?: string): Promise<void>;
|
||||
};
|
||||
|
||||
type InviteAcceptFormTexts = {
|
||||
loadingLabel: string;
|
||||
invalidLinkLabel: string;
|
||||
emailLabel: string;
|
||||
nameLabel: string;
|
||||
passwordLabel: string;
|
||||
passwordConfirmLabel: string;
|
||||
submitLabel: string;
|
||||
googleLabel: string;
|
||||
};
|
||||
type InviteAcceptFormProps = {
|
||||
texts: InviteAcceptFormTexts;
|
||||
tokenState: AccountInviteTokenState;
|
||||
loading?: boolean;
|
||||
initialName?: string | null;
|
||||
showGoogleSignIn?: boolean;
|
||||
googleLoading?: boolean;
|
||||
onSubmit: (values: {
|
||||
name: string;
|
||||
password: string;
|
||||
passwordConfirm: string;
|
||||
}) => void | Promise<void>;
|
||||
onGoogleSignIn?: () => void | Promise<void>;
|
||||
};
|
||||
declare function InviteAcceptForm({ texts, tokenState, loading, initialName, showGoogleSignIn, googleLoading, onSubmit, onGoogleSignIn }: InviteAcceptFormProps): react_jsx_runtime.JSX.Element;
|
||||
|
||||
type LoginFormTexts = {
|
||||
nameLabel: string;
|
||||
emailLabel: string;
|
||||
@@ -132,4 +177,4 @@ type PasswordResetConfirmFormProps = {
|
||||
declare function PasswordResetRequestForm({ texts, helperText, loading, requestSent, onSubmit, emailPlaceholder }: PasswordResetRequestFormProps): react_jsx_runtime.JSX.Element;
|
||||
declare function PasswordResetConfirmForm({ texts, tokenState, loading, completedMode, onSubmit }: PasswordResetConfirmFormProps): react_jsx_runtime.JSX.Element;
|
||||
|
||||
export { AuthGuard, type AuthProviderAvailability, type AuthProviderKey, type AuthSubmitValues, LoginForm, type LoginMode, PasswordResetConfirmForm, type PasswordResetMode, PasswordResetRequestForm, type PasswordResetTokenState, createAuthClient };
|
||||
export { type AccountInviteTokenState, AuthGuard, type AuthProviderAvailability, type AuthProviderKey, type AuthSubmitValues, InviteAcceptForm, LoginForm, type LoginMode, PasswordResetConfirmForm, type PasswordResetMode, PasswordResetRequestForm, type PasswordResetTokenState, createAuthClient };
|
||||
|
||||
Reference in New Issue
Block a user