nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.78k stars 3.49k forks source link

Creating an Appwrite Adapter #7709

Open Adarsreg opened 1 year ago

Adarsreg commented 1 year ago

Description πŸ““

An adapter for appwrite that would basically allow users to interact with appwrite's database.

Here is the documentation for interacting with appwrite's database using its SDK: https://appwrite.io/docs/client/databases?sdk=web-default#databases

Here is a basic example of an ansynchronous getUser function that can be implemented:

async getUser(sessionToken) { return πŸ’š }

Reference on creating a custom adapter for Nextauthjs : https://next-auth.js.org/adapters/overview#custom-adapter

How to reproduce β˜•οΈ

Purpose of the feature is to allow interaction of user data from/to appwrite database. Basically the features of an adapter.

Here are some key features and methods typically found in an adapter for NextAuth.js:

For example:

getUser(id: string): Retrieves a user from the database based on the provided user ID. getUserByEmail(email: string): Retrieves a user from the database based on the provided email address. createUser(user: Omit<AdapterUser, "id">): Creates a new user in the database with the provided user data. updateUser(user: AdapterUser): Updates an existing user in the database with the provided user data. deleteUser(id: string): Deletes a user from the database based on the provided user ID.

Refer to the docs for more info.

Contributing πŸ™ŒπŸ½

Yes, I am willing to help implement this feature in a PR

Chaitanya-Upadhye commented 1 year ago

Hey, I'd also be glad to contribute to implement this