steven-tey / precedent

An opinionated collection of components, hooks, and utilities for your Next.js project.
https://precedent.dev
MIT License
4.69k stars 409 forks source link

Added Twitter auth #9

Closed yasinkavakliat closed 1 year ago

yasinkavakliat commented 1 year ago

This PR adds Twitter authentication to NextAuth. Additionally it fixes an issue with Twitter OAuth 2.0 which doesn't return the users email address and can cause issues in the user-dropdown.tsx component because otherwise it'd return null.

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to the Elegance Team on Vercel.

A member of the Team first needs to authorize it.

steven-tey commented 1 year ago

Great addition! The only concern I have here is there will be an extra step for folks who wanna clone and deploy this without editing the code locally. Is there a way we can check if the TWITTER_CLIENT_ID and TWITTER_CLIENT_SECRET variables are defined, if so, then we show the Twitter login button; if not, we hide it?

agustif commented 1 year ago

Great addition! The only concern I have here is there will be an extra step for folks who wanna clone and deploy this without editing the code locally. Is there a way we can check if the TWITTER_CLIENT_ID and TWITTER_CLIENT_SECRET variables are defined, if so, then we show the Twitter login button; if not, we hide it?

I think this can be handled through next-auth list of enabled providers