@medplum/react 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/cjs/Container/Container.d.ts +3 -0
- package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/cjs/Document/Document.d.ts +3 -6
- package/dist/cjs/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/cjs/Panel/Panel.d.ts +11 -0
- package/dist/cjs/Timeline/Timeline.d.ts +2 -4
- package/dist/cjs/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/cjs/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/cjs/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/cjs/auth/MfaForm.d.ts +7 -0
- package/dist/cjs/auth/OktaButton.d.ts +5 -0
- package/dist/cjs/auth/SignInForm.d.ts +10 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +410 -215
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/stories/referenceLab.d.ts +3 -1
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.js +116 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.js.map +1 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js +2 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +1 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js +3 -0
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +1 -1
- package/dist/esm/CodeInput/CodeInput.js +3 -2
- package/dist/esm/CodeInput/CodeInput.js.map +1 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js +18 -18
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +1 -1
- package/dist/esm/CodingInput/CodingInput.js +3 -2
- package/dist/esm/CodingInput/CodingInput.js.map +1 -1
- package/dist/esm/Container/Container.d.ts +3 -0
- package/dist/esm/Container/Container.js +20 -0
- package/dist/esm/Container/Container.js.map +1 -0
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js +8 -2
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +1 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/esm/Document/Document.d.ts +3 -6
- package/dist/esm/Document/Document.js +5 -6
- package/dist/esm/Document/Document.js.map +1 -1
- package/dist/esm/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/esm/FhirPathTable/FhirPathTable.js.map +1 -1
- package/dist/esm/Panel/Panel.d.ts +11 -0
- package/dist/esm/Panel/Panel.js +35 -0
- package/dist/esm/Panel/Panel.js.map +1 -0
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js +3 -3
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +1 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js +6 -6
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +1 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.js +1 -0
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +1 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js +4 -3
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +1 -1
- package/dist/esm/ResourceInput/ResourceInput.js +2 -1
- package/dist/esm/ResourceInput/ResourceInput.js.map +1 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js +4 -0
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +1 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js +4 -0
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +1 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.js +3 -2
- package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +1 -1
- package/dist/esm/SearchControl/SearchControl.js +2 -1
- package/dist/esm/SearchControl/SearchControl.js.map +1 -1
- package/dist/esm/StatusBadge/StatusBadge.js +2 -1
- package/dist/esm/StatusBadge/StatusBadge.js.map +1 -1
- package/dist/esm/Timeline/Timeline.d.ts +2 -4
- package/dist/esm/Timeline/Timeline.js +14 -10
- package/dist/esm/Timeline/Timeline.js.map +1 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js +24 -44
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +1 -1
- package/dist/esm/auth/AuthenticationForm.js +2 -2
- package/dist/esm/auth/AuthenticationForm.js.map +1 -1
- package/dist/esm/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/esm/auth/ChooseProfileForm.js.map +1 -1
- package/dist/esm/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/esm/auth/ChooseScopeForm.js.map +1 -1
- package/dist/esm/auth/MfaForm.d.ts +7 -0
- package/dist/esm/auth/MfaForm.js +34 -0
- package/dist/esm/auth/MfaForm.js.map +1 -0
- package/dist/esm/auth/NewProjectForm.js +5 -4
- package/dist/esm/auth/NewProjectForm.js.map +1 -1
- package/dist/esm/auth/NewUserForm.js +7 -6
- package/dist/esm/auth/NewUserForm.js.map +1 -1
- package/dist/esm/auth/OktaButton.d.ts +5 -0
- package/dist/esm/auth/SignInForm.d.ts +10 -0
- package/dist/esm/auth/SignInForm.js +16 -0
- package/dist/esm/auth/SignInForm.js.map +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/stories/referenceLab.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueSetAutocomplete.js","sources":["../../../src/ValueSetAutocomplete/ValueSetAutocomplete.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ValueSetAutocomplete.js","sources":["../../../src/ValueSetAutocomplete/ValueSetAutocomplete.tsx"],"sourcesContent":["import { ElementDefinition, ValueSetExpansionContains } from '@medplum/fhirtypes';\nimport React, { useCallback } from 'react';\nimport {\n AsyncAutocomplete,\n AsyncAutocompleteOption,\n AsyncAutocompleteProps,\n} from '../AsyncAutocomplete/AsyncAutocomplete';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ValueSetAutocompleteProps\n extends Omit<AsyncAutocompleteProps<ValueSetExpansionContains>, 'loadOptions' | 'toKey' | 'toOption'> {\n elementDefinition: ElementDefinition;\n}\n\nfunction toKey(element: ValueSetExpansionContains): string {\n return element.code as string;\n}\n\nfunction toOption(element: ValueSetExpansionContains): AsyncAutocompleteOption<ValueSetExpansionContains> {\n return {\n value: element.code as string,\n label: getDisplay(element),\n resource: element,\n };\n}\n\nfunction createValue(input: string): ValueSetExpansionContains {\n return {\n code: input,\n display: input,\n };\n}\n\nexport function ValueSetAutocomplete(props: ValueSetAutocompleteProps): JSX.Element {\n const medplum = useMedplum();\n const { elementDefinition, ...rest } = props;\n\n const loadValues = useCallback(\n async (input: string, signal: AbortSignal): Promise<ValueSetExpansionContains[]> => {\n const system = elementDefinition.binding?.valueSet as string;\n const valueSet = await medplum.searchValueSet(system, input, { signal });\n const valueSetElements = valueSet.expansion?.contains as ValueSetExpansionContains[];\n const newData: ValueSetExpansionContains[] = [];\n\n for (const valueSetElement of valueSetElements) {\n if (valueSetElement.code && !newData.some((item) => item.code === valueSetElement.code)) {\n newData.push(valueSetElement);\n }\n }\n\n return newData;\n },\n [medplum, elementDefinition]\n );\n\n return (\n <AsyncAutocomplete\n {...rest}\n creatable\n clearable\n toKey={toKey}\n toOption={toOption}\n loadOptions={loadValues}\n getCreateLabel={(query) => `+ Create ${query}`}\n onCreate={createValue}\n />\n );\n}\n\nfunction getDisplay(item: ValueSetExpansionContains): string {\n return item.display || item.code || '';\n}\n"],"names":[],"mappings":";;;;;AAcA,SAAS,KAAK,CAAC,OAAkC,EAAA;IAC/C,OAAO,OAAO,CAAC,IAAc,CAAC;AAChC,CAAC;AAED,SAAS,QAAQ,CAAC,OAAkC,EAAA;IAClD,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,IAAc;AAC7B,QAAA,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;AAC1B,QAAA,QAAQ,EAAE,OAAO;KAClB,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAA;IAChC,OAAO;AACL,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC;AAEK,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,iBAAiB,EAAA,GAAc,KAAK,EAAd,IAAI,GAAA,MAAA,CAAK,KAAK,EAAtC,CAA8B,mBAAA,CAAA,CAAQ,CAAC;IAE7C,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAO,KAAa,EAAE,MAAmB,KAA0C,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;;QACjF,MAAM,MAAM,GAAG,CAAA,EAAA,GAAA,iBAAiB,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,QAAkB,CAAC;AAC7D,QAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACzE,MAAM,gBAAgB,GAAG,CAAA,EAAA,GAAA,QAAQ,CAAC,SAAS,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,QAAuC,CAAC;QACrF,MAAM,OAAO,GAAgC,EAAE,CAAC;AAEhD,QAAA,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE;YAC9C,IAAI,eAAe,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,CAAC,EAAE;AACvF,gBAAA,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC/B,aAAA;AACF,SAAA;AAED,QAAA,OAAO,OAAO,CAAC;KAChB,CAAA,EACD,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAC7B,CAAC;AAEF,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,iBAAiB,EACZ,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,IACR,SAAS,EAAA,IAAA,EACT,SAAS,EAAA,IAAA,EACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,UAAU,EACvB,cAAc,EAAE,CAAC,KAAK,KAAK,CAAY,SAAA,EAAA,KAAK,EAAE,EAC9C,QAAQ,EAAE,WAAW,EAAA,CAAA,CACrB,EACF;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAA+B,EAAA;IACjD,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;AACzC;;;;"}
|
|
@@ -43,10 +43,10 @@ function AuthenticationForm(props) {
|
|
|
43
43
|
React.createElement(Stack, { spacing: "xl" },
|
|
44
44
|
React.createElement(TextInput, { name: "email", type: "email", label: "Email", placeholder: "name@domain.com", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'email') }),
|
|
45
45
|
React.createElement(PasswordInput, { name: "password", type: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') })),
|
|
46
|
-
React.createElement(Group, { position: "apart", mt: "xl", noWrap: true },
|
|
46
|
+
React.createElement(Group, { position: "apart", mt: "xl", spacing: 0, noWrap: true },
|
|
47
47
|
onForgotPassword && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onForgotPassword, size: "xs" }, "Forgot password")),
|
|
48
48
|
onRegister && (React.createElement(Anchor, { component: "button", type: "button", color: "dimmed", onClick: onRegister, size: "xs" }, "Register")),
|
|
49
|
-
React.createElement(Checkbox, { id: "remember", name: "remember", label: "Remember me", size: "xs" }),
|
|
49
|
+
React.createElement(Checkbox, { id: "remember", name: "remember", label: "Remember me", size: "xs", sx: { lineHeight: 1 } }),
|
|
50
50
|
React.createElement(Button, { type: "submit" }, "Sign in"))));
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationForm.js","sources":["../../../src/auth/AuthenticationForm.tsx"],"sourcesContent":["import {\n Alert,\n Anchor,\n Button,\n Center,\n Checkbox,\n Divider,\n Group,\n PasswordInput,\n Stack,\n TextInput,\n} from '@mantine/core';\nimport {\n BaseLoginRequest,\n GoogleCredentialResponse,\n GoogleLoginRequest,\n LoginAuthenticationResponse,\n} from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\n\nexport interface AuthenticationFormProps extends BaseLoginRequest {\n readonly generatePkce?: boolean;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function AuthenticationForm(props: AuthenticationFormProps): JSX.Element {\n const { generatePkce, onForgotPassword, onRegister, handleAuthResponse, children, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const googleClientId = getGoogleClientId(props.googleClientId);\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n async function startPkce(): Promise<void> {\n if (generatePkce) {\n await medplum.startPkce();\n }\n }\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n startPkce()\n .then(() =>\n medplum.startLogin({\n ...baseLoginRequest,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'on',\n })\n )\n .then(handleAuthResponse)\n .catch(setOutcome);\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={(response: GoogleCredentialResponse) => {\n startPkce()\n .then(() =>\n medplum.startGoogleLogin({\n ...baseLoginRequest,\n googleCredential: response.credential,\n } as GoogleLoginRequest)\n )\n .then(props.handleAuthResponse)\n .catch(setOutcome);\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n type=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n </Stack>\n <Group position=\"apart\" mt=\"xl\" noWrap>\n {onForgotPassword && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onForgotPassword} size=\"xs\">\n Forgot password\n </Anchor>\n )}\n {onRegister && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onRegister} size=\"xs\">\n Register\n </Anchor>\n )}\n <Checkbox id=\"remember\" name=\"remember\" label=\"Remember me\" size=\"xs\" />\n <Button type=\"submit\">Sign in</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkCM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAA0B,GAAA,KAAK,EAA1B,gBAAgB,GAAA,MAAA,CAAK,KAAK,EAAzG,CAAA,cAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,UAAA,CAAiG,CAAQ,CAAC;AAChH,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE1D,IAAA,SAAe,SAAS,GAAA;;AACtB,YAAA,IAAI,YAAY,EAAE;AAChB,gBAAA,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;AAC3B,aAAA;SACF,CAAA,CAAA;AAAA,KAAA;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAC,QAAgC,KAAI;AAC7C,YAAA,SAAS,EAAE;AACR,iBAAA,IAAI,CAAC,MACJ,OAAO,CAAC,UAAU,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACb,gBAAgB,CAAA,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C,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACpB,gBAAgB,CAAA,EAAA,EACnB,gBAAgB,EAAE,QAAQ,CAAC,UAAU,EAAA,CAChB,CAAC,CACzB;AACA,6BAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;6BAC9B,KAAK,CAAC,UAAU,CAAC,CAAC;AACvB,qBAAC,GACD,CACI;AACR,YAAA,KAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,KAAK,EAAC,IAAI,EAAC,aAAa,EAAC,QAAQ,EAAC,EAAE,EAAC,IAAI,EAAA,CAAG,CACpD,CACJ;AACD,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,OAAO,EAAC,IAAI,EAAA;AACjB,YAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,OAAO,EACb,WAAW,EAAC,iBAAiB,EAC7B,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,EAC1C,CAAA;AACF,YAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,EACZ,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,UAAU,EAChB,YAAY,EAAC,KAAK,EAClB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,GAC7C,CACI;
|
|
1
|
+
{"version":3,"file":"AuthenticationForm.js","sources":["../../../src/auth/AuthenticationForm.tsx"],"sourcesContent":["import {\n Alert,\n Anchor,\n Button,\n Center,\n Checkbox,\n Divider,\n Group,\n PasswordInput,\n Stack,\n TextInput,\n} from '@mantine/core';\nimport {\n BaseLoginRequest,\n GoogleCredentialResponse,\n GoogleLoginRequest,\n LoginAuthenticationResponse,\n} from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\n\nexport interface AuthenticationFormProps extends BaseLoginRequest {\n readonly generatePkce?: boolean;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function AuthenticationForm(props: AuthenticationFormProps): JSX.Element {\n const { generatePkce, onForgotPassword, onRegister, handleAuthResponse, children, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const googleClientId = getGoogleClientId(props.googleClientId);\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n async function startPkce(): Promise<void> {\n if (generatePkce) {\n await medplum.startPkce();\n }\n }\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n startPkce()\n .then(() =>\n medplum.startLogin({\n ...baseLoginRequest,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'on',\n })\n )\n .then(handleAuthResponse)\n .catch(setOutcome);\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={(response: GoogleCredentialResponse) => {\n startPkce()\n .then(() =>\n medplum.startGoogleLogin({\n ...baseLoginRequest,\n googleCredential: response.credential,\n } as GoogleLoginRequest)\n )\n .then(props.handleAuthResponse)\n .catch(setOutcome);\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n type=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n </Stack>\n <Group position=\"apart\" mt=\"xl\" spacing={0} noWrap>\n {onForgotPassword && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onForgotPassword} size=\"xs\">\n Forgot password\n </Anchor>\n )}\n {onRegister && (\n <Anchor component=\"button\" type=\"button\" color=\"dimmed\" onClick={onRegister} size=\"xs\">\n Register\n </Anchor>\n )}\n <Checkbox id=\"remember\" name=\"remember\" label=\"Remember me\" size=\"xs\" sx={{ lineHeight: 1 }} />\n <Button type=\"submit\">Sign in</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkCM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAA0B,GAAA,KAAK,EAA1B,gBAAgB,GAAA,MAAA,CAAK,KAAK,EAAzG,CAAA,cAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,UAAA,CAAiG,CAAQ,CAAC;AAChH,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;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A,EACZ,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,UAAU,EACf,KAAK,EAAC,UAAU,EAChB,YAAY,EAAC,KAAK,EAClB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,GAC7C,CACI;AACR,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAA,IAAA,EAAA;YAC/C,gBAAgB,KACf,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,IAAI,EAAA,EAAA,iBAAA,CAEnF,CACV;YACA,UAAU,KACT,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAA,EAAA,UAAA,CAE7E,CACV;YACD,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,EAAE,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,EAAI,CAAA;YAC/F,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAiB,EAAA,SAAA,CAAA,CAChC,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { LoginAuthenticationResponse } from '@medplum/core';
|
|
2
3
|
import { ProjectMembership } from '@medplum/fhirtypes';
|
|
3
4
|
export interface ChooseProfileFormProps {
|
|
4
5
|
login: string;
|
|
5
6
|
memberships: ProjectMembership[];
|
|
6
|
-
handleAuthResponse: (response:
|
|
7
|
+
handleAuthResponse: (response: LoginAuthenticationResponse) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare function ChooseProfileForm(props: ChooseProfileFormProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseProfileForm.js","sources":["../../../src/auth/ChooseProfileForm.tsx"],"sourcesContent":["import { Avatar, Center, Group, Stack, Text, Title, UnstyledButton } from '@mantine/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseProfileFormProps {\n login: string;\n memberships: ProjectMembership[];\n handleAuthResponse: (response:
|
|
1
|
+
{"version":3,"file":"ChooseProfileForm.js","sources":["../../../src/auth/ChooseProfileForm.tsx"],"sourcesContent":["import { Avatar, Center, Group, Stack, Text, Title, UnstyledButton } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseProfileFormProps {\n login: string;\n memberships: ProjectMembership[];\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function ChooseProfileForm(props: ChooseProfileFormProps): JSX.Element {\n const medplum = useMedplum();\n return (\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Choose profile</Title>\n </Center>\n {props.memberships.map((membership: ProjectMembership) => (\n <UnstyledButton\n key={membership.id}\n onClick={() => {\n medplum\n .post('auth/profile', {\n login: props.login,\n profile: membership.id,\n })\n .then(props.handleAuthResponse)\n .catch(console.log);\n }}\n >\n <Group>\n <Avatar radius=\"xl\" />\n <div style={{ flex: 1 }}>\n <Text size=\"sm\" weight={500}>\n {membership.profile?.display}\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n {membership.project?.display}\n </Text>\n </div>\n </Group>\n </UnstyledButton>\n ))}\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;;;AAaM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,QACE,oBAAC,KAAK,EAAA,IAAA;QACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;YAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;QACR,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAA6B,KAAI;;AAAC,YAAA,QACxD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,UAAU,CAAC,EAAE,EAClB,OAAO,EAAE,MAAK;oBACZ,OAAO;yBACJ,IAAI,CAAC,cAAc,EAAE;wBACpB,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,OAAO,EAAE,UAAU,CAAC,EAAE;qBACvB,CAAC;AACD,yBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,yBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;iBACvB,EAAA;AAED,gBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;AACJ,oBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,MAAM,EAAC,IAAI,EAAG,CAAA;AACtB,oBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAA;AACrB,wBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,IAAI,EAAC,MAAM,EAAE,GAAG,EAAA,EACxB,MAAA,UAAU,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,OAAO,CACvB;wBACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA,EAC3B,MAAA,UAAU,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,CACvB,CACH,CACA,CACO,EAClB;SAAA,CAAC,CACI,EACR;AACJ;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { LoginAuthenticationResponse } from '@medplum/core';
|
|
2
3
|
export interface ChooseScopeFormProps {
|
|
3
4
|
login: string;
|
|
4
5
|
scope: string | undefined;
|
|
5
|
-
handleAuthResponse: (response:
|
|
6
|
+
handleAuthResponse: (response: LoginAuthenticationResponse) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare function ChooseScopeForm(props: ChooseScopeFormProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseScopeForm.js","sources":["../../../src/auth/ChooseScopeForm.tsx"],"sourcesContent":["import { Button, Center, Checkbox, Group, Stack, Title } from '@mantine/core';\nimport React from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseScopeFormProps {\n login: string;\n scope: string | undefined;\n handleAuthResponse: (response:
|
|
1
|
+
{"version":3,"file":"ChooseScopeForm.js","sources":["../../../src/auth/ChooseScopeForm.tsx"],"sourcesContent":["import { Button, Center, Checkbox, Group, Stack, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport React from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface ChooseScopeFormProps {\n login: string;\n scope: string | undefined;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function ChooseScopeForm(props: ChooseScopeFormProps): JSX.Element {\n const medplum = useMedplum();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n medplum\n .post('auth/scope', {\n login: props.login,\n scope: Object.keys(formData).join(' '),\n })\n .then(props.handleAuthResponse)\n .catch(console.log);\n }}\n >\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Choose scope</Title>\n </Center>\n <Stack>\n {(props.scope || 'openid').split(' ').map((scopeName: string) => (\n <Checkbox key={scopeName} id={scopeName} name={scopeName} label={scopeName} defaultChecked />\n ))}\n </Stack>\n <Group position=\"right\" mt=\"xl\">\n <Button type=\"submit\">Set scope</Button>\n </Group>\n </Stack>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;AAaM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAC,QAAgC,KAAI;YAC7C,OAAO;iBACJ,IAAI,CAAC,YAAY,EAAE;gBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACvC,CAAC;AACD,iBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,iBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SACvB,EAAA;AAED,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;YACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;gBAClB,KAAC,CAAA,aAAA,CAAA,KAAK,uBAAqB,CACpB;YACT,KAAC,CAAA,aAAA,CAAA,KAAK,QACH,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,SAAiB,MAC1D,oBAAC,QAAQ,EAAA,EAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAA,IAAA,EAAA,CAAG,CAC9F,CAAC,CACI;YACR,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAA;gBAC7B,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAC,QAAQ,gBAAmB,CAClC,CACF,CACH,EACP;AACJ;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LoginAuthenticationResponse } from '@medplum/core';
|
|
3
|
+
export interface MfaFormProps {
|
|
4
|
+
login: string;
|
|
5
|
+
handleAuthResponse: (response: LoginAuthenticationResponse) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function MfaForm(props: MfaFormProps): JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Stack, Center, Title, Alert, TextInput, Group, Button } from '@mantine/core';
|
|
2
|
+
import { normalizeErrorString } from '@medplum/core';
|
|
3
|
+
import { IconAlertCircle } from '@tabler/icons';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { Form } from '../Form/Form.js';
|
|
6
|
+
import { Logo } from '../Logo/Logo.js';
|
|
7
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
8
|
+
|
|
9
|
+
function MfaForm(props) {
|
|
10
|
+
const medplum = useMedplum();
|
|
11
|
+
const [errorMessage, setErrorMessage] = useState(undefined);
|
|
12
|
+
return (React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: (formData) => {
|
|
13
|
+
setErrorMessage(undefined);
|
|
14
|
+
medplum
|
|
15
|
+
.post('auth/mfa/verify', {
|
|
16
|
+
login: props.login,
|
|
17
|
+
token: formData.token,
|
|
18
|
+
})
|
|
19
|
+
.then(props.handleAuthResponse)
|
|
20
|
+
.catch((err) => setErrorMessage(normalizeErrorString(err)));
|
|
21
|
+
} },
|
|
22
|
+
React.createElement(Stack, null,
|
|
23
|
+
React.createElement(Center, { sx: { flexDirection: 'column' } },
|
|
24
|
+
React.createElement(Logo, { size: 32 }),
|
|
25
|
+
React.createElement(Title, null, "Enter MFA code")),
|
|
26
|
+
errorMessage && (React.createElement(Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Error", color: "red" }, errorMessage)),
|
|
27
|
+
React.createElement(Stack, null,
|
|
28
|
+
React.createElement(TextInput, { name: "token", label: "MFA code", required: true })),
|
|
29
|
+
React.createElement(Group, { position: "right", mt: "xl" },
|
|
30
|
+
React.createElement(Button, { type: "submit" }, "Submit code")))));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { MfaForm };
|
|
34
|
+
//# sourceMappingURL=MfaForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MfaForm.js","sources":["../../../src/auth/MfaForm.tsx"],"sourcesContent":["import { Alert, Button, Center, Group, Stack, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse, normalizeErrorString } from '@medplum/core';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\n\nexport interface MfaFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function MfaForm(props: MfaFormProps): JSX.Element {\n const medplum = useMedplum();\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={(formData: Record<string, string>) => {\n setErrorMessage(undefined);\n medplum\n .post('auth/mfa/verify', {\n login: props.login,\n token: formData.token,\n })\n .then(props.handleAuthResponse)\n .catch((err) => setErrorMessage(normalizeErrorString(err)));\n }}\n >\n <Stack>\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Enter MFA code</Title>\n </Center>\n {errorMessage && (\n <Alert icon={<IconAlertCircle size={16} />} title=\"Error\" color=\"red\">\n {errorMessage}\n </Alert>\n )}\n <Stack>\n <TextInput name=\"token\" label=\"MFA code\" required />\n </Stack>\n <Group position=\"right\" mt=\"xl\">\n <Button type=\"submit\">Submit code</Button>\n </Group>\n </Stack>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAaM,SAAU,OAAO,CAAC,KAAmB,EAAA;AACzC,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;AAChF,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAC,QAAgC,KAAI;YAC7C,eAAe,CAAC,SAAS,CAAC,CAAC;YAC3B,OAAO;iBACJ,IAAI,CAAC,iBAAiB,EAAE;gBACvB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,QAAQ,CAAC,KAAK;aACtB,CAAC;AACD,iBAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAC9B,iBAAA,KAAK,CAAC,CAAC,GAAG,KAAK,eAAe,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAC/D,EAAA;AAED,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;YACJ,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;gBAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;YACR,YAAY,KACX,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,KAAK,EAAA,EAClE,YAAY,CACP,CACT;AACD,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA;AACJ,gBAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAA,IAAA,EAAA,CAAG,CAC9C;YACR,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAA;gBAC7B,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,IAAI,EAAC,QAAQ,kBAAqB,CACpC,CACF,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import { Center, Title, Stack, TextInput, Text, Group, Button } from '@mantine/core';
|
|
2
|
+
import { Center, Title, Stack, TextInput, Text, Anchor, Group, Button } from '@mantine/core';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { Form } from '../Form/Form.js';
|
|
5
5
|
import { Logo } from '../Logo/Logo.js';
|
|
@@ -26,10 +26,11 @@ function NewProjectForm(props) {
|
|
|
26
26
|
React.createElement(Stack, { spacing: "xl" },
|
|
27
27
|
React.createElement(TextInput, { name: "projectName", label: "Project Name", placeholder: "My Project", required: true, autoFocus: true, error: getErrorsForInput(outcome, 'firstName') }),
|
|
28
28
|
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
29
|
-
"By clicking submit you agree to the Medplum
|
|
30
|
-
|
|
29
|
+
"By clicking submit you agree to the Medplum",
|
|
30
|
+
' ',
|
|
31
|
+
React.createElement(Anchor, { href: "https://www.medplum.com/privacy" }, "Privacy\u00A0Policy"),
|
|
31
32
|
' and ',
|
|
32
|
-
React.createElement(
|
|
33
|
+
React.createElement(Anchor, { href: "https://www.medplum.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
33
34
|
".")),
|
|
34
35
|
React.createElement(Group, { position: "right", mt: "xl", noWrap: true },
|
|
35
36
|
React.createElement(Button, { type: "submit" }, "Create project"))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProjectForm.js","sources":["../../../src/auth/NewProjectForm.tsx"],"sourcesContent":["import { Button, Center, Group, Stack, Text, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface NewProjectFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewProjectForm(props: NewProjectFormProps): JSX.Element {\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n props.handleAuthResponse(\n await medplum.startNewProject({\n login: props.login,\n projectName: formData.projectName,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Create project</Title>\n </Center>\n <Stack spacing=\"xl\">\n <TextInput\n name=\"projectName\"\n label=\"Project Name\"\n placeholder=\"My Project\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum <
|
|
1
|
+
{"version":3,"file":"NewProjectForm.js","sources":["../../../src/auth/NewProjectForm.tsx"],"sourcesContent":["import { Anchor, Button, Center, Group, Stack, Text, TextInput, Title } from '@mantine/core';\nimport { LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { Logo } from '../Logo/Logo';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface NewProjectFormProps {\n login: string;\n handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewProjectForm(props: NewProjectFormProps): JSX.Element {\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n props.handleAuthResponse(\n await medplum.startNewProject({\n login: props.login,\n projectName: formData.projectName,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>\n <Logo size={32} />\n <Title>Create project</Title>\n </Center>\n <Stack spacing=\"xl\">\n <TextInput\n name=\"projectName\"\n label=\"Project Name\"\n placeholder=\"My Project\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum{' '}\n <Anchor href=\"https://www.medplum.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://www.medplum.com/terms\">Terms of Service</Anchor>.\n </Text>\n </Stack>\n <Group position=\"right\" mt=\"xl\" noWrap>\n <Button type=\"submit\">Create project</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAcM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgC,CAAC;AACvE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EACxB,QAAQ,EAAE,CAAO,QAAgC,KAAI,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;YACnD,IAAI;AACF,gBAAA,KAAK,CAAC,kBAAkB,CACtB,MAAM,OAAO,CAAC,eAAe,CAAC;oBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,WAAW,EAAE,QAAQ,CAAC,WAAW;AAClC,iBAAA,CAAC,CACH,CAAC;AACH,aAAA;AAAC,YAAA,OAAO,GAAG,EAAE;gBACZ,UAAU,CAAC,GAAuB,CAAC,CAAC;AACrC,aAAA;AACH,SAAC,CAAA,EAAA;QAED,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAA;AACrC,YAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA;YAClB,KAAC,CAAA,aAAA,CAAA,KAAK,yBAAuB,CACtB;AACT,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,OAAO,EAAC,IAAI,EAAA;AACjB,YAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,IAAI,EAAC,aAAa,EAClB,KAAK,EAAC,cAAc,EACpB,WAAW,EAAC,YAAY,EACxB,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,EAC9C,CAAA;YACF,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA;;gBACgB,GAAG;AAC/C,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,iCAAiC,EAA6B,EAAA,qBAAA,CAAA;gBAC1E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,+BAA+B,EAAoC,EAAA,4BAAA,CAAA;oBAC3E,CACD;QACR,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAA,IAAA,EAAA;YACpC,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAwB,EAAA,gBAAA,CAAA,CACvC,CACH,EACP;AACJ;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import { Center, Alert, Group, Divider, Stack, TextInput, PasswordInput, Text, Checkbox, Button } from '@mantine/core';
|
|
2
|
+
import { Center, Alert, Group, Divider, Stack, TextInput, PasswordInput, Text, Anchor, Checkbox, Button } from '@mantine/core';
|
|
3
3
|
import { IconAlertCircle } from '@tabler/icons';
|
|
4
4
|
import React, { useState, useEffect } from 'react';
|
|
5
5
|
import { Form } from '../Form/Form.js';
|
|
@@ -60,17 +60,18 @@ function NewUserForm(props) {
|
|
|
60
60
|
React.createElement(TextInput, { name: "email", type: "email", label: "Email", placeholder: "name@domain.com", required: true, error: getErrorsForInput(outcome, 'email') }),
|
|
61
61
|
React.createElement(PasswordInput, { name: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') }),
|
|
62
62
|
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
63
|
-
"By clicking submit you agree to the Medplum
|
|
64
|
-
|
|
63
|
+
"By clicking submit you agree to the Medplum",
|
|
64
|
+
' ',
|
|
65
|
+
React.createElement(Anchor, { href: "https://www.medplum.com/privacy" }, "Privacy\u00A0Policy"),
|
|
65
66
|
' and ',
|
|
66
|
-
React.createElement(
|
|
67
|
+
React.createElement(Anchor, { href: "https://www.medplum.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
67
68
|
"."),
|
|
68
69
|
React.createElement(Text, { color: "dimmed", size: "xs" },
|
|
69
70
|
"This site is protected by reCAPTCHA and the Google",
|
|
70
71
|
' ',
|
|
71
|
-
React.createElement(
|
|
72
|
+
React.createElement(Anchor, { href: "https://policies.google.com/privacy" }, "Privacy\u00A0Policy"),
|
|
72
73
|
' and ',
|
|
73
|
-
React.createElement(
|
|
74
|
+
React.createElement(Anchor, { href: "https://policies.google.com/terms" }, "Terms\u00A0of\u00A0Service"),
|
|
74
75
|
" apply.")),
|
|
75
76
|
React.createElement(Group, { position: "apart", mt: "xl", noWrap: true },
|
|
76
77
|
React.createElement(Checkbox, { name: "remember", label: "Remember me", size: "xs" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewUserForm.js","sources":["../../../src/auth/NewUserForm.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"NewUserForm.js","sources":["../../../src/auth/NewUserForm.tsx"],"sourcesContent":["import {\n Alert,\n Anchor,\n Button,\n Center,\n Checkbox,\n Divider,\n Group,\n PasswordInput,\n Stack,\n Text,\n TextInput,\n} from '@mantine/core';\nimport { GoogleCredentialResponse, LoginAuthenticationResponse } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { useEffect, useState } from 'react';\nimport { Form } from '../Form/Form';\nimport { getGoogleClientId, GoogleButton } from '../GoogleButton/GoogleButton';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getErrorsForInput, getIssuesForExpression } from '../utils/outcomes';\nimport { getRecaptcha, initRecaptcha } from '../utils/recaptcha';\n\nexport interface NewUserFormProps {\n readonly projectId: string;\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly handleAuthResponse: (response: LoginAuthenticationResponse) => void;\n}\n\nexport function NewUserForm(props: NewUserFormProps): JSX.Element {\n const googleClientId = getGoogleClientId(props.googleClientId);\n const recaptchaSiteKey = props.recaptchaSiteKey;\n const medplum = useMedplum();\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n useEffect(() => initRecaptcha(recaptchaSiteKey), [recaptchaSiteKey]);\n\n return (\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n const recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n props.handleAuthResponse(\n await medplum.startNewUser({\n projectId: props.projectId,\n firstName: formData.firstName,\n lastName: formData.lastName,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'true',\n recaptchaSiteKey,\n recaptchaToken,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <Center sx={{ flexDirection: 'column' }}>{props.children}</Center>\n {issues && (\n <Alert icon={<IconAlertCircle size={16} />} color=\"red\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </Alert>\n )}\n {googleClientId && (\n <>\n <Group position=\"center\" p=\"xl\" style={{ height: 70 }}>\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={async (response: GoogleCredentialResponse) => {\n try {\n await medplum.startPkce();\n props.handleAuthResponse(\n await medplum.startGoogleLogin({\n googleClientId: response.clientId,\n googleCredential: response.credential,\n createUser: true,\n })\n );\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n />\n </Group>\n <Divider label=\"or\" labelPosition=\"center\" my=\"lg\" />\n </>\n )}\n <Stack spacing=\"xl\">\n <TextInput\n name=\"firstName\"\n type=\"text\"\n label=\"First name\"\n placeholder=\"First name\"\n required={true}\n autoFocus={true}\n error={getErrorsForInput(outcome, 'firstName')}\n />\n <TextInput\n name=\"lastName\"\n type=\"text\"\n label=\"Last name\"\n placeholder=\"Last name\"\n required={true}\n error={getErrorsForInput(outcome, 'lastName')}\n />\n <TextInput\n name=\"email\"\n type=\"email\"\n label=\"Email\"\n placeholder=\"name@domain.com\"\n required={true}\n error={getErrorsForInput(outcome, 'email')}\n />\n <PasswordInput\n name=\"password\"\n label=\"Password\"\n autoComplete=\"off\"\n required={true}\n error={getErrorsForInput(outcome, 'password')}\n />\n <Text color=\"dimmed\" size=\"xs\">\n By clicking submit you agree to the Medplum{' '}\n <Anchor href=\"https://www.medplum.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://www.medplum.com/terms\">Terms of Service</Anchor>.\n </Text>\n <Text color=\"dimmed\" size=\"xs\">\n This site is protected by reCAPTCHA and the Google{' '}\n <Anchor href=\"https://policies.google.com/privacy\">Privacy Policy</Anchor>\n {' and '}\n <Anchor href=\"https://policies.google.com/terms\">Terms of Service</Anchor> apply.\n </Text>\n </Stack>\n <Group position=\"apart\" mt=\"xl\" noWrap>\n <Checkbox name=\"remember\" label=\"Remember me\" size=\"xs\" />\n <Button type=\"submit\">Create account</Button>\n </Group>\n </Form>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AA+BM,SAAU,WAAW,CAAC,KAAuB,EAAA;IACjD,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAC/D,IAAA,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MA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A,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,iCAAiC,EAA6B,EAAA,qBAAA,CAAA;gBAC1E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,+BAA+B,EAAoC,EAAA,4BAAA,CAAA;AAC3E,gBAAA,GAAA,CAAA;YACP,KAAC,CAAA,aAAA,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA;;gBACuB,GAAG;AACtD,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,qCAAqC,EAA6B,EAAA,qBAAA,CAAA;gBAC9E,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,mCAAmC,EAAoC,EAAA,4BAAA,CAAA;0BAC/E,CACD;QACR,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAA,IAAA,EAAA;AACpC,YAAA,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAG,CAAA;YAC1D,KAAC,CAAA,aAAA,CAAA,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAwB,EAAA,gBAAA,CAAA,CACvC,CACH,EACP;AACJ;;;;"}
|
|
@@ -8,4 +8,14 @@ export interface SignInFormProps extends BaseLoginRequest {
|
|
|
8
8
|
readonly onCode?: (code: string) => void;
|
|
9
9
|
readonly children?: React.ReactNode;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* The SignInForm component allows users to sign in to Medplum.
|
|
13
|
+
*
|
|
14
|
+
* "Signing in" is a multi-step process:
|
|
15
|
+
* 1) Authentication - identify the user
|
|
16
|
+
* 2) MFA - If MFA is enabled, prompt for MFA code
|
|
17
|
+
* 3) Choose profile - If the user has multiple profiles, prompt to choose one
|
|
18
|
+
* 4) Choose scope - If the user has multiple scopes, prompt to choose one
|
|
19
|
+
* 5) Success - Return to the caller with either a code or a redirect
|
|
20
|
+
*/
|
|
11
21
|
export declare function SignInForm(props: SignInFormProps): JSX.Element;
|
|
@@ -5,14 +5,27 @@ import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
|
|
|
5
5
|
import { AuthenticationForm } from './AuthenticationForm.js';
|
|
6
6
|
import { ChooseProfileForm } from './ChooseProfileForm.js';
|
|
7
7
|
import { ChooseScopeForm } from './ChooseScopeForm.js';
|
|
8
|
+
import { MfaForm } from './MfaForm.js';
|
|
8
9
|
import { NewProjectForm } from './NewProjectForm.js';
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* The SignInForm component allows users to sign in to Medplum.
|
|
13
|
+
*
|
|
14
|
+
* "Signing in" is a multi-step process:
|
|
15
|
+
* 1) Authentication - identify the user
|
|
16
|
+
* 2) MFA - If MFA is enabled, prompt for MFA code
|
|
17
|
+
* 3) Choose profile - If the user has multiple profiles, prompt to choose one
|
|
18
|
+
* 4) Choose scope - If the user has multiple scopes, prompt to choose one
|
|
19
|
+
* 5) Success - Return to the caller with either a code or a redirect
|
|
20
|
+
*/
|
|
10
21
|
function SignInForm(props) {
|
|
11
22
|
const { chooseScopes, onSuccess, onForgotPassword, onRegister, onCode } = props, baseLoginRequest = __rest(props, ["chooseScopes", "onSuccess", "onForgotPassword", "onRegister", "onCode"]);
|
|
12
23
|
const medplum = useMedplum();
|
|
13
24
|
const [login, setLogin] = useState(undefined);
|
|
25
|
+
const [mfaRequired, setAuthenticatorRequired] = useState(false);
|
|
14
26
|
const [memberships, setMemberships] = useState(undefined);
|
|
15
27
|
function handleAuthResponse(response) {
|
|
28
|
+
setAuthenticatorRequired(!!response.mfaRequired);
|
|
16
29
|
if (response.login) {
|
|
17
30
|
setLogin(response.login);
|
|
18
31
|
}
|
|
@@ -50,6 +63,9 @@ function SignInForm(props) {
|
|
|
50
63
|
if (!login) {
|
|
51
64
|
return (React.createElement(AuthenticationForm, Object.assign({ generatePkce: !onCode, onForgotPassword: onForgotPassword, onRegister: onRegister, handleAuthResponse: handleAuthResponse }, baseLoginRequest), props.children));
|
|
52
65
|
}
|
|
66
|
+
else if (mfaRequired) {
|
|
67
|
+
return React.createElement(MfaForm, { login: login, handleAuthResponse: handleAuthResponse });
|
|
68
|
+
}
|
|
53
69
|
else if (memberships) {
|
|
54
70
|
return React.createElement(ChooseProfileForm, { login: login, memberships: memberships, handleAuthResponse: handleAuthResponse });
|
|
55
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInForm.js","sources":["../../../src/auth/SignInForm.tsx"],"sourcesContent":["import { BaseLoginRequest, LoginAuthenticationResponse } from '@medplum/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Document } from '../Document/Document';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { AuthenticationForm } from './AuthenticationForm';\nimport { ChooseProfileForm } from './ChooseProfileForm';\nimport { ChooseScopeForm } from './ChooseScopeForm';\nimport { NewProjectForm } from './NewProjectForm';\n\nexport interface SignInFormProps extends BaseLoginRequest {\n readonly chooseScopes?: boolean;\n readonly onSuccess?: () => void;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly onCode?: (code: string) => void;\n readonly children?: React.ReactNode;\n}\n\nexport function SignInForm(props: SignInFormProps): JSX.Element {\n const { chooseScopes, onSuccess, onForgotPassword, onRegister, onCode, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const [login, setLogin] = useState<string | undefined>(undefined);\n const [memberships, setMemberships] = useState<ProjectMembership[] | undefined>(undefined);\n\n function handleAuthResponse(response: LoginAuthenticationResponse): void {\n if (response.login) {\n setLogin(response.login);\n }\n\n if (response.memberships) {\n setMemberships(response.memberships);\n }\n\n if (response.code) {\n if (chooseScopes) {\n setMemberships(undefined);\n } else {\n handleCode(response.code as string);\n }\n }\n }\n\n function handleScopeResponse(response: LoginAuthenticationResponse): void {\n handleCode(response.code as string);\n }\n\n function handleCode(code: string): void {\n if (onCode) {\n onCode(code);\n } else {\n medplum\n .processCode(code)\n .then(() => {\n if (onSuccess) {\n onSuccess();\n }\n })\n .catch(console.log);\n }\n }\n\n return (\n <Document width={450}>\n {(() => {\n if (!login) {\n return (\n <AuthenticationForm\n generatePkce={!onCode}\n onForgotPassword={onForgotPassword}\n onRegister={onRegister}\n handleAuthResponse={handleAuthResponse}\n {...baseLoginRequest}\n >\n {props.children}\n </AuthenticationForm>\n );\n } else if (memberships) {\n return <ChooseProfileForm login={login} memberships={memberships} handleAuthResponse={handleAuthResponse} />;\n } else if (props.projectId === 'new') {\n return <NewProjectForm login={login} handleAuthResponse={handleAuthResponse} />;\n } else if (props.chooseScopes) {\n return <ChooseScopeForm login={login} scope={props.scope} handleAuthResponse={handleScopeResponse} />;\n } else {\n return <div>Success</div>;\n }\n })()}\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SignInForm.js","sources":["../../../src/auth/SignInForm.tsx"],"sourcesContent":["import { BaseLoginRequest, LoginAuthenticationResponse } from '@medplum/core';\nimport { ProjectMembership } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { Document } from '../Document/Document';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { AuthenticationForm } from './AuthenticationForm';\nimport { ChooseProfileForm } from './ChooseProfileForm';\nimport { ChooseScopeForm } from './ChooseScopeForm';\nimport { MfaForm } from './MfaForm';\nimport { NewProjectForm } from './NewProjectForm';\n\nexport interface SignInFormProps extends BaseLoginRequest {\n readonly chooseScopes?: boolean;\n readonly onSuccess?: () => void;\n readonly onForgotPassword?: () => void;\n readonly onRegister?: () => void;\n readonly onCode?: (code: string) => void;\n readonly children?: React.ReactNode;\n}\n\n/**\n * The SignInForm component allows users to sign in to Medplum.\n *\n * \"Signing in\" is a multi-step process:\n * 1) Authentication - identify the user\n * 2) MFA - If MFA is enabled, prompt for MFA code\n * 3) Choose profile - If the user has multiple profiles, prompt to choose one\n * 4) Choose scope - If the user has multiple scopes, prompt to choose one\n * 5) Success - Return to the caller with either a code or a redirect\n */\nexport function SignInForm(props: SignInFormProps): JSX.Element {\n const { chooseScopes, onSuccess, onForgotPassword, onRegister, onCode, ...baseLoginRequest } = props;\n const medplum = useMedplum();\n const [login, setLogin] = useState<string | undefined>(undefined);\n const [mfaRequired, setAuthenticatorRequired] = useState<boolean>(false);\n const [memberships, setMemberships] = useState<ProjectMembership[] | undefined>(undefined);\n\n function handleAuthResponse(response: LoginAuthenticationResponse): void {\n setAuthenticatorRequired(!!response.mfaRequired);\n\n if (response.login) {\n setLogin(response.login);\n }\n\n if (response.memberships) {\n setMemberships(response.memberships);\n }\n\n if (response.code) {\n if (chooseScopes) {\n setMemberships(undefined);\n } else {\n handleCode(response.code as string);\n }\n }\n }\n\n function handleScopeResponse(response: LoginAuthenticationResponse): void {\n handleCode(response.code as string);\n }\n\n function handleCode(code: string): void {\n if (onCode) {\n onCode(code);\n } else {\n medplum\n .processCode(code)\n .then(() => {\n if (onSuccess) {\n onSuccess();\n }\n })\n .catch(console.log);\n }\n }\n\n return (\n <Document width={450}>\n {(() => {\n if (!login) {\n return (\n <AuthenticationForm\n generatePkce={!onCode}\n onForgotPassword={onForgotPassword}\n onRegister={onRegister}\n handleAuthResponse={handleAuthResponse}\n {...baseLoginRequest}\n >\n {props.children}\n </AuthenticationForm>\n );\n } else if (mfaRequired) {\n return <MfaForm login={login} handleAuthResponse={handleAuthResponse} />;\n } else if (memberships) {\n return <ChooseProfileForm login={login} memberships={memberships} handleAuthResponse={handleAuthResponse} />;\n } else if (props.projectId === 'new') {\n return <NewProjectForm login={login} handleAuthResponse={handleAuthResponse} />;\n } else if (props.chooseScopes) {\n return <ChooseScopeForm login={login} scope={props.scope} handleAuthResponse={handleScopeResponse} />;\n }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AAC,cAAc,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAA,CAAI,CAAC;AACjF,SAAA;aAAM,IAAI,KAAK,CAAC,YAAY,EAAE;AAC7B,YAAA,OAAO,oBAAC,eAAe,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,GAAI,CAAC;AACvG,SAAA;AAAM,aAAA;AACL,YAAA,OAAO,2CAAkB,CAAC;AAC3B,SAAA;AACH,KAAC,GAAG,CACK,EACX;AACJ;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './AddressDisplay/AddressDisplay';
|
|
2
2
|
export * from './AddressInput/AddressInput';
|
|
3
3
|
export * from './AnnotationInput/AnnotationInput';
|
|
4
|
+
export * from './AsyncAutocomplete/AsyncAutocomplete';
|
|
4
5
|
export * from './AttachmentArrayDisplay/AttachmentArrayDisplay';
|
|
5
6
|
export * from './AttachmentArrayInput/AttachmentArrayInput';
|
|
6
7
|
export * from './AttachmentButton/AttachmentButton';
|
|
@@ -21,6 +22,7 @@ export * from './ContactDetailDisplay/ContactDetailDisplay';
|
|
|
21
22
|
export * from './ContactDetailInput/ContactDetailInput';
|
|
22
23
|
export * from './ContactPointDisplay/ContactPointDisplay';
|
|
23
24
|
export * from './ContactPointInput/ContactPointInput';
|
|
25
|
+
export * from './Container/Container';
|
|
24
26
|
export * from './DateTimeInput/DateTimeInput';
|
|
25
27
|
export * from './DefaultResourceTimeline/DefaultResourceTimeline';
|
|
26
28
|
export * from './DescriptionList/DescriptionList';
|
|
@@ -39,6 +41,7 @@ export * from './IdentifierInput/IdentifierInput';
|
|
|
39
41
|
export * from './Logo/Logo';
|
|
40
42
|
export * from './MedplumLink/MedplumLink';
|
|
41
43
|
export * from './MedplumProvider/MedplumProvider';
|
|
44
|
+
export * from './Panel/Panel';
|
|
42
45
|
export * from './PatientTimeline/PatientTimeline';
|
|
43
46
|
export * from './PlanDefinitionBuilder/PlanDefinitionBuilder';
|
|
44
47
|
export * from './QuantityDisplay/QuantityDisplay';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AddressDisplay } from './AddressDisplay/AddressDisplay.js';
|
|
2
2
|
export { AddressInput } from './AddressInput/AddressInput.js';
|
|
3
3
|
export { AnnotationInput } from './AnnotationInput/AnnotationInput.js';
|
|
4
|
+
export { AsyncAutocomplete } from './AsyncAutocomplete/AsyncAutocomplete.js';
|
|
4
5
|
export { AttachmentArrayDisplay } from './AttachmentArrayDisplay/AttachmentArrayDisplay.js';
|
|
5
6
|
export { AttachmentArrayInput } from './AttachmentArrayInput/AttachmentArrayInput.js';
|
|
6
7
|
export { AttachmentButton } from './AttachmentButton/AttachmentButton.js';
|
|
@@ -21,6 +22,7 @@ export { ContactDetailDisplay } from './ContactDetailDisplay/ContactDetailDispla
|
|
|
21
22
|
export { ContactDetailInput } from './ContactDetailInput/ContactDetailInput.js';
|
|
22
23
|
export { ContactPointDisplay } from './ContactPointDisplay/ContactPointDisplay.js';
|
|
23
24
|
export { ContactPointInput } from './ContactPointInput/ContactPointInput.js';
|
|
25
|
+
export { Container } from './Container/Container.js';
|
|
24
26
|
export { DateTimeInput, convertIsoToLocal, convertLocalToIso } from './DateTimeInput/DateTimeInput.js';
|
|
25
27
|
export { DefaultResourceTimeline } from './DefaultResourceTimeline/DefaultResourceTimeline.js';
|
|
26
28
|
export { DescriptionList, DescriptionListEntry } from './DescriptionList/DescriptionList.js';
|
|
@@ -39,6 +41,7 @@ export { IdentifierInput } from './IdentifierInput/IdentifierInput.js';
|
|
|
39
41
|
export { Logo } from './Logo/Logo.js';
|
|
40
42
|
export { MedplumLink } from './MedplumLink/MedplumLink.js';
|
|
41
43
|
export { MedplumProvider, useMedplum, useMedplumContext, useMedplumProfile } from './MedplumProvider/MedplumProvider.js';
|
|
44
|
+
export { Panel } from './Panel/Panel.js';
|
|
42
45
|
export { PatientTimeline } from './PatientTimeline/PatientTimeline.js';
|
|
43
46
|
export { PlanDefinitionBuilder } from './PlanDefinitionBuilder/PlanDefinitionBuilder.js';
|
|
44
47
|
export { QuantityDisplay } from './QuantityDisplay/QuantityDisplay.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|