Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/next-auth-4.23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeya authored Oct 16, 2023
2 parents afeaf28 + d5c18ae commit 4a559e1
Showing 1 changed file with 110 additions and 108 deletions.
218 changes: 110 additions & 108 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,114 +93,116 @@ export default createSchema({
});
```

or copy paste the schemas

```ts
// user - required

export default {
name: 'user',
title: 'User',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'email',
title: 'Email',
type: 'string'
},
{
name: 'image',
title: 'Image',
type: 'url'
},
{
// this is only if you use credentials provider
name: 'password',
type: 'string',
hidden: true
},
{
name: 'emailVerified',
type: 'datetime',
hidden: true,
}
]
};
```

```ts
// account - required

export default {
name: 'account',
title: 'Account',
type: 'document',
fields: [
{
name: 'providerType',
type: 'string'
},
{
name: 'providerId',
type: 'string'
},
{
name: 'providerAccountId',
type: 'string'
},
{
name: 'refreshToken',
type: 'string'
},
{
name: 'accessToken',
type: 'string'
},
{
name: 'accessTokenExpires',
type: 'number'
},
{
name: 'user',
title: 'User',
type: 'reference',
to: { type: 'user' }
}
]
};
```

```ts
// verification-token - only if you use email provider

export default {
name: 'verification-token',
title: 'Verification Token',
type: 'document',
fields: [
{
name: 'identifier',
title: 'Identifier',
type: 'string'
},
{
name: 'token',
title: 'Token',
type: 'string'
},
{
name: 'expires',
title: 'Expires',
type: 'datetime'
}
]
};
```
<details>
<summary>Or copy paste the schemas</summary>

```ts
// user - required

export default {
name: 'user',
title: 'User',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'email',
title: 'Email',
type: 'string'
},
{
name: 'image',
title: 'Image',
type: 'url'
},
{
// this is only if you use credentials provider
name: 'password',
type: 'string',
hidden: true
},
{
name: 'emailVerified',
type: 'datetime',
hidden: true,
}
]
};
```

```ts
// account - required

export default {
name: 'account',
title: 'Account',
type: 'document',
fields: [
{
name: 'providerType',
type: 'string'
},
{
name: 'providerId',
type: 'string'
},
{
name: 'providerAccountId',
type: 'string'
},
{
name: 'refreshToken',
type: 'string'
},
{
name: 'accessToken',
type: 'string'
},
{
name: 'accessTokenExpires',
type: 'number'
},
{
name: 'user',
title: 'User',
type: 'reference',
to: { type: 'user' }
}
]
};
```

```ts
// verification-token - only if you use email provider

export default {
name: 'verification-token',
title: 'Verification Token',
type: 'document',
fields: [
{
name: 'identifier',
title: 'Identifier',
type: 'string'
},
{
name: 'token',
title: 'Token',
type: 'string'
},
{
name: 'expires',
title: 'Expires',
type: 'datetime'
}
]
};
```
</details>

### Sign Up and Sign In With Credentials

Expand Down

0 comments on commit 4a559e1

Please sign in to comment.