Skip to content

Commit

Permalink
Merge main into next
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Aug 26, 2021
1 parent 55ab95e commit a49903f
Show file tree
Hide file tree
Showing 12 changed files with 773 additions and 1,301 deletions.
2,029 changes: 741 additions & 1,288 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/providers/yandex.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Yandex(options) {
id: profile.id,
name: profile.real_name,
email: profile.default_email,
image: null,
image: profile.is_avatar_empty ? null : `https://avatars.yandex.net/get-yapic/${profile.default_avatar_id}/islands-200`,
}
},
options,
Expand Down
2 changes: 2 additions & 0 deletions www/docs/configuration/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ callbacks: {
...
```

If you're using TypeScript, you will want to [augment the session type](/getting-started/typescript#module-augmentation).

:::tip
When using JSON Web Tokens the `jwt()` callback is invoked before the `session()` callback, so anything you add to the
JSON Web Token will be immediately available in the session callback, like for example an `access_token` from a provider.
Expand Down
2 changes: 1 addition & 1 deletion www/docs/configuration/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The message will be an object and contain:

### signOut

Sent when the user signs out.
Sent when the user signs out (logout).

The message object will contain one of these depending on if you use JWT or database persisted sessions:

Expand Down
17 changes: 17 additions & 0 deletions www/docs/configuration/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ Options are passed to NextAuth.js when initializing it in an API route.

An array of authentication providers for signing in (e.g. Google, Facebook, Twitter, GitHub, Email, etc) in any order. This can be one of the built-in providers or an object with a custom provider.

If you need to use an asynchronous function in your provider instantiation, you can setup your `[...nextauth].js` file like so:

```js
export default async function handler(req, res) {
NextAuth(req, res, {
providers: [
Providers.IdentityServer4({
id: "identity-server",
clientSecret: await GetSecret(),
}),
],
})
}
```

See the [providers documentation](/configuration/providers) for a list of supported providers and how to use them.

---
Expand Down Expand Up @@ -123,6 +138,7 @@ jwt: {
// Defaults to NextAuth.js secret if not explicitly specified.
// This is used to generate the actual signingKey and produces a warning
// message if not defined explicitly.
// You can generate a secret be using `openssl rand -base64 64`
secret: 'INp8IvdIyeMcoGAgFGoA61DdBglwwSqnXJZkgz8PSnw',
// You can generate a signing key using `jose newkey -s 512 -t oct -a HS512`
// This gives you direct knowledge of the key used to sign the token so you can use it
Expand All @@ -140,6 +156,7 @@ jwt: {
},
// Set to true to use encryption. Defaults to false (signing only).
encryption: true,
// You can generate an encryption key by using `npx node-jose-tools newkey -s 256 -t oct -a A256GCM -u enc`
encryptionKey: "",
// decryptionKey: encryptionKey,
decryptionOptions: {
Expand Down
2 changes: 1 addition & 1 deletion www/docs/getting-started/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The easiest way to get started is to clone the [example app](https://github.com/

### Add API route

To add NextAuth.js to a project create a file called `[...nextauth].js` in `pages/api/auth`.
To add NextAuth.js to a project create a file called `[...nextauth].js` in `pages/api/auth`. NextAuth.js requires no modification to the `next.config.js` file.

[Read more about how to add authentication providers.](/configuration/providers)

Expand Down
2 changes: 1 addition & 1 deletion www/docs/getting-started/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For OAuth 2.0 providers that support the `checks: ["state"]` option, the state p

#### `GET` /api/auth/signout

Displays the sign out page.
Displays the sign out page allowing the user to logout.

#### `POST` /api/auth/signout

Expand Down
6 changes: 5 additions & 1 deletion www/docs/providers/azure-ad-b2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ title: Azure Active Directory B2C

## Documentation

https://docs.microsoft.com/en-us/azure/active-directory-b2c/
https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow

## Configuration

https://docs.microsoft.com/azure/active-directory-b2c/tutorial-create-tenant

## Options

Expand Down
2 changes: 1 addition & 1 deletion www/docs/providers/bungie.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ providers: [
### Configuration

:::tip
Bungie require all sites to run HTTPS (including local development instances).
Bungie requires all sites to run HTTPS (including local development instances).
:::

:::tip
Expand Down
2 changes: 1 addition & 1 deletion www/docs/providers/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const html = ({ url, site, email }) => {
<td align="center" style="padding: 20px 0;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" style="border-radius: 5px;" bgcolor="${buttonBackgroundColor}"><a href="${url}" target="_blank" style="font-size: 18px; font-family: Helvetica, Arial, sans-serif; color: ${buttonTextColor}; text-decoration: none; text-decoration: none;border-radius: 5px; padding: 10px 20px; border: 1px solid ${buttonBorderColor}; display: inline-block; font-weight: bold;">Sign in</a></td>
<td align="center" style="border-radius: 5px;" bgcolor="${buttonBackgroundColor}"><a href="${url}" target="_blank" style="font-size: 18px; font-family: Helvetica, Arial, sans-serif; color: ${buttonTextColor}; text-decoration: none; border-radius: 5px; padding: 10px 20px; border: 1px solid ${buttonBorderColor}; display: inline-block; font-weight: bold;">Sign in</a></td>
</tr>
</table>
</td>
Expand Down
4 changes: 2 additions & 2 deletions www/docs/tutorials/testing-with-cypress.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To get started, install the dependencies:
`npm install --save-dev cypress cypress-social-logins @testing-library/cypress`

:::note
If you are using username/password based login, you will not need the `cypress-social-login` dependency.
If you are using username/password based login, you will not need the `cypress-social-logins` dependency.
:::

Cypress will install and initialize the folder structure with example integration tests, a folder for plugins, etc.
Expand Down Expand Up @@ -43,7 +43,7 @@ Second, a cypress file for environment variables. These can be defined in `cypre

You must change the login credentials you want to use, but you can also redefine the name of the `GOOGLE_*` variables if you're using a different provider. `COOKIE_NAME`, however, must be set to that value for NextAuth.js.

Third, if you're using the `cypress-social-login` plugin, you must add this to your `/cypress/plugins/index.js` file like so:
Third, if you're using the `cypress-social-logins` plugin, you must add this to your `/cypress/plugins/index.js` file like so:

```js title="cypress/plugins/index.js"
const { GoogleSocialLogin } = require('cypress-social-logins').plugins
Expand Down
4 changes: 0 additions & 4 deletions www/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ module.exports = {
label: "Next documentation",
to: "https://next-auth-git-next.nextauthjs.vercel.app",
},
{
label: "Next documentation",
to: "https://next-auth-git-next.nextauthjs.vercel.app",
},
],
},
{
Expand Down

0 comments on commit a49903f

Please sign in to comment.