-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement user login #861
base: main
Are you sure you want to change the base?
Implement user login #861
Conversation
@otobot1 you can take a look at the workflow and styling. I'm left with server logging (and maybe converting the foreign key changes to a single transaction). /claim-user for claiming, /verify-claim for verifying the user. |
@@ -11,7 +11,7 @@ type CreateUser = (user: PrismaUser) => Awaitable<TrimmedUser>; | |||
|
|||
const getCreateUser = (prisma: PrismaClient): CreateUser => { | |||
return (user: PrismaUser): Awaitable<TrimmedUser> => { | |||
const { id, ...rest } = user; //remove the discord id from the user object - a replacement is auto-generated by Prisma | |||
const { id, email, emailVerified, ...rest } = user; //remove the discord id from the user object - a replacement is auto-generated by Prisma |
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.
Not type safe, but we need this to make auth work?
I should be able to take a look this weekend! |
combine user-claim related pages into single folder
make explicit that we don't want people duplicating their ratings
Tweak UserClaim column and relation names
required by next.js pagesRouter
backend only. frontend tweaks forthcoming. -split userClaim endpoints into a subrouter -place the user and userClaim router files into a new folder -tweak userClaim api to make userClaims non-public, as they don't need to be public -tweak userClaim router for formatting and readability, and make it match existing routers more closely -wrap the userClaim verification db calls into a transaction
-add check for claimedUser to verification endpoint
Hey @ShouvikGhosh2048 . I didn't quite manage to get through the entire thing this weekend, but I think it's in a state where you can keep working on it. I'm happy with the tRPC api now (although we still need server logging), but I didn't have a chance to really look at or adjust the frontend to match the backend changes, so I've left the frontend in a broken state (sorry!). I'll get to it when I can, and will mark this as a draft again when I do. In the meantime, please feel free to work on the remaining pages or any other backend stuff. If you'd like to work on the pages you already created, please mark this PR as a draft and also make both pages work with the backend changes. |
Closes #766.