Replies: 2 comments 2 replies
-
Is there a way to link the User to DiscordUser if they join as Mod in the future? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Table added with both imageId and imaggeURL. Once once is in use, I will remove the other. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've talked about this before, but I wanted to toss up some thoughts on this in more detail.
A few suppositions form these thoughts:
If we look at my extended comment at https://github.com/JacobMGEvans/ts-cult-bot/blob/main/bot/src/commands/create-job-posting.ts#L90 we can see that the job posting command is currently creating only a User row and not an Account row, and in doing so is placing the Discord ID into the
id
field on User (instead of theproviderAccountId
on Account) and placing the id of the image into the image field (instead of a URL).At the bare minimum this would need adjusting to that the data matches what next-auth is creating. The comment I made covers that, should we go that route. I don't think that's the solve though. I propose instead a DiscordUsers table, perhaps with the following schema:
If we go this route then working with users from the bot side will be far simpler, and from the dashboard side we don't need to filter these out of pages that display all mods, etc.
Currently the
provider
andproviderAccountId
fields on Account are unique. If we leave that and don't create a DiscordUsers table then we need to test that a user can still login to the dashboard. We probably need to either remove that unique flag which is probably a bad idea or we need to fully commit to creating users in the Account+User table from the bot, up to and including theprovider
andproviderAccountId
and test that a user created by the bot can still login through the Dashboard. This would apply to someone who posts a job, etc, and then later becomes a mod.Beta Was this translation helpful? Give feedback.
All reactions