Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/configuration/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ jwt: {
// Defaults to `session.maxAge`.
maxAge: 60 * 60 * 24 * 30,
// You can define your own encode/decode functions for signing and encryption
// if you want to override the default behaviour.
// if you want to override the default behavior.
async encode({ secret, token, maxAge }) {},
async decode({ secret, token, maxAge }) {},
async decode({ secret, token }) {},
}
```

Expand Down
11 changes: 0 additions & 11 deletions docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ The algorithm used for generating your key isn't listed as supported. You can ge
jose newkey -s 512 -t oct -a HS512
```

If you are unable to use an HS512 key (for example to interoperate with other services) you can define what is supported using

```
jwt: {
signingKey: {"kty":"oct","kid":"--","alg":"HS256","k":"--"},
verificationOptions: {
algorithms: ["HS256"]
}
}
```

#### SESSION_ERROR

---
Expand Down
10 changes: 5 additions & 5 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Ultimately if your request is not accepted or is not actively in development, yo

<details>
<summary>
<h3 style={{display:"inline-block"}}>Does NextAuth.js use JSON Web Tokens?</h3>
<h3>Does NextAuth.js use JSON Web Tokens?</h3>
</summary>
<p>

Expand All @@ -282,7 +282,7 @@ You can also choose to use JSON Web Tokens as session tokens with using a databa

<details>
<summary>
<h3 style={{display:"inline-block"}}>What are the advantages of JSON Web Tokens?</h3>
<h3>What are the advantages of JSON Web Tokens?</h3>
</summary>
<p>

Expand All @@ -301,7 +301,7 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot

<details>
<summary>
<h3 style={{display:"inline-block"}}>What are the disadvantages of JSON Web Tokens?</h3>
<h3>What are the disadvantages of JSON Web Tokens?</h3>
</summary>
<p>

Expand Down Expand Up @@ -330,7 +330,7 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot

<details>
<summary>
<h3 style={{display:"inline-block"}}>Are JSON Web Tokens secure?</h3>
<h3>Are JSON Web Tokens secure?</h3>
</summary>
<p>

Expand All @@ -347,7 +347,7 @@ Using explicit public/private keys for signing is strongly recommended.

<details>
<summary>
<h3 style={{display:"inline-block"}}>What signing and encryption standards does NextAuth.js support?</h3>
<h3>What signing and encryption standards does NextAuth.js support?</h3>
</summary>
<p>

Expand Down
40 changes: 40 additions & 0 deletions docs/getting-started/upgrade-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,46 @@ events: {

Introduced in https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-next.20

## JWT configuration

We have removed some of the [configuration options](/configuration/options) when using JSON Web Tokens, [here's the PR](https://github.com/nextauthjs/next-auth/pull/3039) for more context.

```diff
export default NextAuth({
// ...
jwt: {
secret,
maxAge,
- encryptionKey
- signingKey
- encryptionKey
- verificationOptions
encode({
token
secret
maxAge
- signingKey
- signingOptions
- encryptionKey
- encryptionOptions
- encryption
}) {},
decode({
token
secret
- maxAge
- signingKey
- verificationKey
- verificationOptions
- encryptionKey
- decryptionKey
- decryptionOptions
- encryption
}) {}
}
})
```

## Logger API

The logger API has been simplified to use at most two parameters, where the second is usually an object (`metadata`) containing an `error` object. If you are not using the logger settings you can ignore this change.
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/ldap-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export default NextAuth({
},
secret: process.env.NEXTAUTH_SECRET,
jwt: {
secret: process.env.NEXTAUTH_SECRET,
encryption: true, // Very important to encrypt the JWT, otherwise you're leaking username+password into the browser
secret: process.env.JWT_SECRET,
},
})
```
Expand Down
4 changes: 4 additions & 0 deletions src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,7 @@ html[data-theme="dark"] hr {
flex-direction: column;
}
}

.inline {
display: inline-block;
}