Skip to main content

notes-create-new-user-practitioner

Notes on Creating a User Automatically from Registration Page

Server Code: auth/google.ts worker/subscription.ts

Testing/Developing Subscription Webhooks Bots

Previous Notes

  1. Configure ClientApplication for auth of Bot - Create New Practitioner
    • used in "Bot - Create New Practitioner..."" code to authenticate for initial user creation
    • Create in Project: Super Admin (Very Important!)
    • Name: ClientApplication - Create New Practitioner-[env]
    • ProjectMembership: can use default membership created with ClientApplication - change to Admin
  2. Configure Bot for "New Practitioner" creation routine
    • Create in Project: PathCloud-[envrionment]
    • Name: Bot - Create New Practitioner_[environment]
    • Runtime Version: vmcontext
    1. ProjectMembership - can use default membership in PathCloud-[env] - change to Admin
    2. Copy Bot code from /apps/bots/src/create-practitioner-subs-user/botcode.ts
    3. Modify client_id and client_secret constants with values from "ClientApplication - Bot - Auth_PathCloud-[env]"
    4. Click "Save" and "Deploy" in Bot Editor
  3. Configure Subscription for User/Practitioner/Project creation routine
    • Create in Project: PathCloud-[environment]
    • Users will be created with ProjectId supplied in .env; The Subscription must be in the same project.
    • Reason: Create New Practitioner Bot - [environment]
    • Criteria: User
    • Add "extension" to restrict subscriptions to only "CREATE" messages (if not copying json from bot folder)