ai-chatbot
ai-chatbot copied to clipboard
Docs: Add demo for adding OAuth support from Google
First off - really appreciate the package. I'm a solo data engineer hoping to move an internal company chat-interface to a more flexible frontend, and this seems like the most actively developed OSS.
I'm fine with all dependencies, but have really struggled how to easily integrate Google Oauth by simply adding the provider with NextAuth - I'm pretty new to Typescript and for some reason this has proven more difficult than Supabase or Clerk.
Would it be possible to add a brief page to docs/ that depicts how to add Oauth and optionally remove other login/registration functionality.
By doing this, it would provide a simple 1-click deploy starting point for internal company chat applications that place all authentication on Google (and domain restrictions if provided).
@JerePlum99 This shoud do the trick: https://github.com/athrael-soju/ai-chatbot/pull/14
I haven't raised a PR on this repo yet, because I haven't had the time to tidy it up. I picked up some of this code from here: https://github.com/vercel/ai-chatbot/pull/717, which was closed last month.
Just replace the github provider with google and set your redirects as expected and it should work fine. You may need to re-create your db schema, since sso providers don't provide a password.
@athrael-soju This worked great btw - appreciate the help. If I have time later this week I'll try to frame this as an actual doc and submit a PR.
I need to take a look at the changes but would be very worthwhile to figure out how to format the db schemas to support Oauth more out-of-the-box.
@JerePlum99 Thanks for opening this issue, and @athrael-soju for helping!
It sounds like adding this to the documentation would be super helpful for future visitors not that we have our own docs. Will move the docs content here so folks can contribute to it as well.