Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: User UserCreationService in self serve admin creation #19200

Open
wants to merge 9 commits into
base: create-usercreationservice-for-api
Choose a base branch
from

Conversation

joeauyeung
Copy link
Contributor

@joeauyeung joeauyeung commented Feb 9, 2025

Stacked on #19150

What does this PR do?

  • Adds SELF_SERVE_ADMIN to creation source
  • Uses UserCreationService in api/auth/setup endpoint

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Delete all users from the DB
  • Try logging in
    • Should prompt to create a new user
  • Create user

Copy link

vercel bot commented Feb 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cal-com-ui-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 10:48pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 10:48pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 10:48pm

@github-actions github-actions bot added the ❗️ migrations contains migration files label Feb 9, 2025
@keithwillcode keithwillcode added consumer core area: core, team members only labels Feb 9, 2025
Comment on lines -37 to -40
const username = slugify(parsedQuery.data.username.trim());
const userEmail = parsedQuery.data.email_address.toLowerCase();

const hashedPassword = await hashPassword(parsedQuery.data.password);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these two calls to the UserCreationService

API_V1 @map("api_v1")
API_V2 @map("api_v2")
WEBAPP @map("webapp")
SELF_SERVE_ADMIN @map("self_serve_admin")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should expand on the CreationSource to pinpoint where watchlisted users are created

Copy link

graphite-app bot commented Feb 10, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/10/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only ❗️ migrations contains migration files 💻 refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants