simonj
09/25/2025, 5:36 PMfinnbergquist
09/25/2025, 6:23 PM.../auth/login POST?simonj
09/25/2025, 6:27 PMpackages/server/src/oauth/utils.ts I can see for user = await getUserByEmail(request.email, request.projectId); request.projectId is null
It's also null for the Practitioner login but it still finds the usersimonj
09/25/2025, 6:37 PMgetUserByEmail not external IDsimonj
09/25/2025, 7:56 PMsignin?project=10e36fb4-5217-4576-a43f-17b0ae1183d2 param in the app code and it works 🎉simonj
09/25/2025, 8:03 PMsimonj
09/25/2025, 8:10 PMfinnbergquist
09/25/2025, 8:19 PM.../login
You are correct that one way to do this is adding ?project=id in the url params
You can also do this by adding clientId to the MedplumClient instantiation in the app.
const medplum = new MedplumClient({
onUnauthenticated: () => (window.location.href = '/'),
///...
clientId: import.meta.env?.MEDPLUM_CLIENT_ID,
});