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

New contact channels #287

Merged
merged 10 commits into from
Oct 1, 2024
Merged

New contact channels #287

merged 10 commits into from
Oct 1, 2024

Conversation

fomalhautb
Copy link
Contributor

@fomalhautb fomalhautb commented Sep 30, 2024

This is a redesign of the contact channels/auth:

  • Each contact channel has isVerified, usedForAuth, isPrimary attributes
  • You can login with any contact channel that is usedForAuth
  • otp/password auth methods now are not bound with identifier/contact channel

Copy link

vercel bot commented Sep 30, 2024

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

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 4:13am
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 4:13am
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 4:13am
stack-partial-prerendering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 4:13am

Copy link

zeropath-ai bot commented Sep 30, 2024

Security

  • No security or compliance vulnerabilities detected
  • Scanned 16 changed file(s)

Changes Detected

  • [Refactor] Update database schema for auth methods [apps/backend/prisma/schema.prisma]

    • Removed contactChannelId from OtpAuthMethod
    • Added usedForAuth to ContactChannel
    • Removed identifier and identifierType from PasswordAuthMethod
  • [Refactor] Modify user authentication logic [apps/backend/src/app/api/v1/auth/*]

    • Updated OTP and password sign-in routes
    • Changed how auth methods are queried and handled
  • [Refactor] Update user CRUD operations [apps/backend/src/app/api/v1/users/crud.tsx]

    • Modified how user data is structured and returned
    • Removed deprecated fields like auth_methods and connected_accounts
  • [Refactor] Simplify user data schema [packages/stack-shared/src/interface/crud/users.ts]

    • Added contact_channels field to user schema
    • Removed deprecated fields and schemas
  • [Test] Update e2e tests for auth and user endpoints [apps/e2e/tests/backend/endpoints/api/v1/*]

    • Modified expected responses in various test cases
    • Adjusted assertions to match new user data structure
  • [Docs] Update README with dependency instructions [README.md]

    • Changed order of dependency management commands

Copy link

Copy link

zeropath-ai bot commented Sep 30, 2024

Security

  • No security or compliance vulnerabilities detected
  • Scanned 16 changed file(s)

Changes Detected

  • [Refactor] Removed OTP contact channel and password identifier [apps/backend/prisma/migrations/20240929194058_remove_otp_contact_channel/migration.sql]

    • Dropped contactChannelId from OtpAuthMethod table
    • Dropped identifier and identifierType from PasswordAuthMethod table
    • Added usedForAuth column to ContactChannel table
  • [Refactor] Updated schema for auth methods and contact channels [apps/backend/prisma/schema.prisma]

    • Modified ContactChannel model to include usedForAuth field
    • Removed contactChannelId from OtpAuthMethod model
    • Removed identifier and identifierType from PasswordAuthMethod model
  • [Refactor] Updated user CRUD operations [apps/backend/src/app/api/v1/users/crud.tsx]

    • Modified userPrismaToCrud function to handle new schema
    • Removed deprecated fields from usersCrudServerReadSchema
  • [Refactor] Updated auth-related API endpoints [Multiple files]

    • Modified OTP and password sign-in routes to use new schema
    • Updated user creation and update logic
  • [Test] Updated E2E tests for new schema [apps/e2e/tests/backend/endpoints/api/v1/*.test.ts]

    • Modified test assertions to match new user data structure
    • Updated expected responses for auth-related endpoints
  • [Docs] Updated README with dependency restart command [README.md]

    • Changed default command from start-deps to restart-deps

Copy link

Copy link

zeropath-ai bot commented Oct 1, 2024

Security

  • No security or compliance vulnerabilities detected
  • Scanned 16 changed file(s)

Changes Detected

  • [Refactor] Remove contact channel from OTP auth method [apps/backend/prisma/schema.prisma]

    • Removed contactChannelId from OtpAuthMethod model
    • Updated unique constraints for OtpAuthMethod
    • Added usedForAuth field to ContactChannel model
  • [Refactor] Simplify password auth method structure [apps/backend/prisma/schema.prisma]

    • Removed identifier and identifierType from PasswordAuthMethod model
    • Updated unique constraints for PasswordAuthMethod
    • Removed PasswordAuthMethodIdentifierType enum
  • [Database] Add migration for OTP and password auth changes [apps/backend/prisma/migrations/20240929194058_remove_otp_contact_channel/migration.sql]

    • Implements schema changes for OTP and password auth methods
    • Updates existing data to set usedForAuth field on ContactChannel
  • [Refactor] Update auth-related API endpoints [apps/backend/src/app/api/v1/auth/]

    • Modified OTP sign-in code sending and verification
    • Updated password sign-in logic
    • Adjusted user creation and authentication flows
  • [Refactor] Simplify user data structure in CRUD operations [apps/backend/src/app/api/v1/users/crud.tsx]

    • Removed auth_methods and connected_accounts from user data
    • Updated user creation, reading, and updating logic
  • [API] Remove deprecated fields from user schemas [packages/stack-shared/src/interface/crud/users.ts]

    • Removed auth_methods and connected_accounts fields
    • Marked auth_with_email and requires_totp_mfa as deprecated

Copy link

github-actions bot commented Oct 1, 2024

@fomalhautb fomalhautb merged commit 28c3f57 into dev Oct 1, 2024
13 checks passed
@fomalhautb fomalhautb deleted the new-contact-channels branch October 1, 2024 04:22
jshimko added a commit to jshimko/stack that referenced this pull request Oct 1, 2024
* dev:
  New contact channels (stack-auth#287)
  Fix team creation on the server not automatically adding the current user (stack-auth#266)
  chore: update package versions
  fixed current user docs
  fixed maybeFullPage layout
jshimko added a commit to jshimko/stack that referenced this pull request Oct 1, 2024
* docker-builds:
  New contact channels (stack-auth#287)
  Fix team creation on the server not automatically adding the current user (stack-auth#266)
  chore: update package versions
  fixed current user docs
  fixed maybeFullPage layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants