-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(user, types): add invite and user properties + migration #6327
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
🦋 Changeset detectedLatest commit: d04316f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/user/src/models/invite.ts
Outdated
expression: `create unique index "invite_user_identifier_index" on "invite" ("user_identifier") where deleted_at is null;`, | ||
}) | ||
@Property({ columnType: "text" }) | ||
user_identifier: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think it is reasonable to just stick with email
. Flow would be something like this:
- User invites new user - enters their email.
- New user receives invite link on email with a token.
- If user wants to authenticate with e.g. Google they complete sign in flow.
- Once authenticated with Google they pass the invite token as part of the user creation call.
- AuthUser is associated with the new User.
I.e., the email is not used to tie a the AuthUser's entity id, but simply ensures there is a trusted destination the invite token can be sent to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Email-password could also be facilitated through the user creation request with an additional step in the workflow to create the auth user.
) | ||
|
||
const originalUsers = await service.list({ | ||
id: input.map((u) => u.id), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: For safety guard, as I have seen it occured in the modules, I would store the ids separately and then id ids.length then call the lists and the update wdyt?
@PrimaryKey({ columnType: "text" }) | ||
id!: string | ||
|
||
@Property({ columnType: "text", nullable: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo(maybe): if a user is searchable by text search then add GIN index on first and last name. but you tell me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
What