I developed a Vite ReactJS web application where users log in using Google OAuth 2.0. Upon logging in, I retrieve the user’s email and given_name and store it in the users
collection in Appwrite. After logging in, users are prompted to set a username, which is also stored in the same collection alongside their email. So, each user in the collection has the following attributes: Document ID
, email
, given_name
, username
, and avatar
.
I extract the email via jwtdecode to store in my Appwrite’s users
collection, while the username is set after the user completes a CAPTCHA. I do not store the email unless the user has set a username and passed the CAPTCHA.
Appwrite provides an Auth feature with Users and Teams, and Google Authentication is one of the services that also provide. When the users authenticate via Google’s plug in of Appwrite, their info gets stored in the Users of Auth section of Appwrite. With my approach, the user info gets stored in the users
collection that I created, and nothing in the Users. So I am confused if I am on the correct path with the user sign up process that I chose to go with.
Currently, my application works as intended. My web app uses @react-oauth/google
for the log in/authentication. I do not have any issues in that regard. I just want to know if my approach is unproblematic, given that Appwrite also provides authentication with Google and stores the data in the built in Users table, while I store the data in the collection that I created. Can someone please clarify?