Skip to content
This repository was archived by the owner on Jul 17, 2022. It is now read-only.

feat(dgraph): initial adapter #170

Closed
wants to merge 2 commits into from
Closed

Conversation

beynar
Copy link
Contributor

@beynar beynar commented Jul 15, 2021

Dgraph Adapater for next-auth  🎉

  • Tests pass
  • No typescript error
  • Create a test database on a free tier

@github-actions github-actions bot added the tests Changes to testing label Jul 15, 2021
@beynar beynar changed the title Dgrap adapter feat(dgraph): initial adapter Jul 15, 2021
@balazsorban44
Copy link
Member

Thank you! That will be awesome! Although it might be worth waiting for nextauthjs/next-auth#2361 to be merged. I am currently rewriting/simplifying the Adapter API and so it could spare both of us some time if we don't merge this to main, but rather into the next branch when that PR is merged in the core.

What do you think? :)

@amaster507
Copy link

Looks good! I have a few suggestions, but let me do a test deploy and test it locally first.

@beynar
Copy link
Contributor Author

beynar commented Jul 15, 2021

@balazsorban44 Yes that seems the smartest thing to do.
If i undersrtand the breaking changes correctly I have to:

  • remove the get adapter method
  • rewrite createVerificationRequest method
  • rewrite getVerificationRequest method
  • rewrite linkAccount method
  • remove deleteVerificationRequest method
  • remove the hashing function
  • remove provider.sendVerificationRequest call

@beynar
Copy link
Contributor Author

beynar commented Jul 15, 2021

Also dgraph has a secure way to store passwords and verify them (see password-type).

While I understand your concern about the security of credentials, this is still a standard way to implement auth in our applications.

So I'm wondering if we could add a method in the adapter that would be responsible to check the validity of a password and returning the user.What do think about that ?

@balazsorban44
Copy link
Member

It's a WIP, so you should probably wait. The list of changes is not complete yet. I'll try my best to sum the necessary changes as good as possible. We are going to write a full migration document to accompany the new release as well. 😊

@balazsorban44
Copy link
Member

balazsorban44 commented Aug 16, 2021

@arnaudDerbey Hopefully you are still around, the new API has been merged, and you can see Prisma and the Fauna adapter implementations for reference!

https://github.com/nextauthjs/adapters/blob/next/packages/prisma/src/index.ts
https://github.com/nextauthjs/adapters/blob/next/packages/fauna/src/index.ts

Please base your branch against next (the easiest way might be to close this PR and open a new one where you start off with the latest next to be honest), and do the necessary changes.

@beynar
Copy link
Contributor Author

beynar commented Aug 16, 2021

Hey@balazsorban44 , still around ! 🤗
I'll check that by the end of the week. Thanks for the reminder and big congrats for the 4.0. !

@balazsorban44
Copy link
Member

balazsorban44 commented Aug 16, 2021

Thanks, it's coming, I hope in a few weeks. 🤞

Feel free to reach out for any help!

@beynar beynar closed this Sep 5, 2021
@lveillard
Copy link

Hello there! Sorry for reviving this one, just curious if @arnaudDerbey did the enhancements for the dgraph adapter

@balazsorban44
Copy link
Member

Recommend following #206

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests Changes to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants