Hi I am following this explanation to create a user / patient in the system:
https://www.medplum.com/docs/auth/user-management-guide
code sample:
const createNewProject = async () => {
await medplum.createResource({
resourceType: 'Project',
name: 'UserOnboardingTester',
strictMode: true,
}).then(response => {
// Handle successful response
console.log('Success:', response);
})
.catch(error => {
// Handle error
console.error('Error:', error);
});
}
const inviteNewUser = async () => {
await medplum.post('admin/projects/a2af95df-e242-42e0-9c37-b05f1589caaf/invite', {
resourceType: 'Patient',
firstName: 'James',
lastName: 'Stone',
email: 'jamesstone@gmail.com',
admin: true,
password:'ap123@!'
}).then(response => {
console.log('Success: ', response);
}).catch(error => {
// Handle error
console.error('Error:', error);
});
}
however then I tried to login I've got user is not found. I've debug the server and it looks like login requires projectId to be provided.
export function SignInPage(): JSX.Element {
const navigate = useNavigate();
//const MEDPLUM_PROJECT_ID='a2af95df-e242-42e0-9c37-b05f1589caaf';
return (
<SignInForm
// Configure according to your settings
projectId="a2af95df-e242-42e0-9c37-b05f1589caaf"
onSuccess={() => navigate('/')}
>
Sign in to Medplum
);
}
without supplying projectId login is failed.
Does the end user need to provide projectId he is connecting to?
Thanks