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

Implement user login #861

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

ShouvikGhosh2048
Copy link
Collaborator

Closes #766.

@ShouvikGhosh2048 ShouvikGhosh2048 marked this pull request as ready for review September 4, 2024 04:11
@ShouvikGhosh2048
Copy link
Collaborator Author

ShouvikGhosh2048 commented Sep 4, 2024

@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
Copy link
Collaborator Author

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?

@otobot1
Copy link
Member

otobot1 commented Sep 10, 2024

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
@otobot1 otobot1 marked this pull request as draft September 15, 2024 22:18
@otobot1 otobot1 marked this pull request as ready for review September 15, 2024 22:18
@otobot1
Copy link
Member

otobot1 commented Sep 15, 2024

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.

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.

Implement User Logins
2 participants