chore(site): refactor useAuth and related hooks (#12567)

Close https://github.com/coder/coder/issues/12487
This commit is contained in:
Bruno Quaresma
2024-03-13 13:24:18 -03:00
committed by GitHub
parent fe6def31eb
commit 489b0ec497
52 changed files with 287 additions and 201 deletions

View File

@ -63,7 +63,7 @@ export interface CreateUserFormProps {
onCancel: () => void;
error?: unknown;
isLoading: boolean;
myOrgId: string;
organizationId: string;
authMethods?: TypesGen.AuthMethods;
}
@ -83,14 +83,14 @@ const validationSchema = Yup.object({
export const CreateUserForm: FC<
React.PropsWithChildren<CreateUserFormProps>
> = ({ onSubmit, onCancel, error, isLoading, myOrgId, authMethods }) => {
> = ({ onSubmit, onCancel, error, isLoading, organizationId, authMethods }) => {
const form: FormikContextType<TypesGen.CreateUserRequest> =
useFormik<TypesGen.CreateUserRequest>({
initialValues: {
email: "",
password: "",
username: "",
organization_id: myOrgId,
organization_id: organizationId,
disable_login: false,
login_type: "",
},