Replies: 1 comment
-
The https://github.com/nextauthjs/adapters/blob/next/packages/prisma/src/index.ts#L18 The interface Account {
/** The user's id this account belongs to. */
userId: string
/** Usually "oauth" */
type: string
/** The provider's id this account belongs to. */
provider: string
/** The account's user id */
providerAccountId: string
/** The raw access token in JWT format */
access_token?: string;
/** Usually "Bearer" */
token_type?: string;
/** The raw id token in JWT format */
id_token?: string;
/** Refresh token, opaque string value */
refresh_token?: string;
/** space-separated scope(s) used for the authentication request */
scope?: string;
/**
* When the token set was received the expires_at field was calculated based on the current timestamp
* and the expires_in value.
*/
expires_at?: number;
/** State value passed in the authentication request*/
session_state?: string;
[key: string]: unknown;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We've had alot of discussions about this topic. In my research I noticed this code snippet which describes the creation of a custom adapter. My attention was drawn to the
linkAccount
field function but their are things I don't understand about it. For one is the first argument the ID of the user returned by the provider or the ID of the currently signed in user trying to link that provider.I'm fine with doing it like this, but personally it seems abit clunky and difficult to read. I think it would make more sense if we had a
linkAccount
function imported from"next-auth/client"
with the same usage assignIn
. The only thing it would require is that you're already signed in, then callinglinkAccount
would invoke the provider authentication procedure for the indicated provider and the new provider would be linked. Those are just my thoughts. I'm not sure how to go about implementing them.Beta Was this translation helpful? Give feedback.
All reactions