Skip to content

Commit

Permalink
fix(ts): adapter interface (#8054)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThangHuuVu authored Jul 16, 2023
1 parent 169a523 commit bd37c55
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions packages/next-auth/src/adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,7 @@ export interface VerificationToken {
* [Adapters Overview](https://next-auth.js.org/adapters/overview) |
* [Create a custom adapter](https://next-auth.js.org/tutorials/creating-a-database-adapter)
*/
export type Adapter<WithVerificationToken = boolean> = DefaultAdapter &
(WithVerificationToken extends true
? {
createVerificationToken: (
verificationToken: VerificationToken
) => Awaitable<VerificationToken | null | undefined>
/**
* Return verification token from the database
* and delete it so it cannot be used again.
*/
useVerificationToken: (params: {
identifier: string
token: string
}) => Awaitable<VerificationToken | null>
}
: {})

export interface DefaultAdapter {
export interface Adapter {
createUser: (user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>
getUser: (id: string) => Awaitable<AdapterUser | null>
getUserByEmail: (email: string) => Awaitable<AdapterUser | null>
Expand Down

1 comment on commit bd37c55

@vercel
Copy link

@vercel vercel bot commented on bd37c55 Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.