Skip to content

Commit 4705632

Browse files
committed
chore: add TODO comment for next major version
1 parent 2296471 commit 4705632

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/next-auth/src/core/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import logger from "../utils/logger"
33
import parseUrl from "../utils/parse-url"
44
import { adapterErrorHandler, eventsErrorHandler } from "./errors"
55
import parseProviders from "./lib/providers"
6-
import createSecret from "./lib/utils"
6+
import { createSecret } from "./lib/utils"
77
import * as cookie from "./lib/cookie"
88
import * as jwt from "../jwt"
99
import { defaultCallbacks } from "./lib/default-callbacks"

packages/next-auth/src/core/lib/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ export function hashToken(token: string, options: InternalOptions<"email">) {
2828
* If no secret option is specified then it creates one on the fly
2929
* based on options passed here. If options contains unique data, such as
3030
* OAuth provider secrets and database credentials it should be sufficent. If no secret provided in production, we throw an error. */
31-
export default function createSecret(params: {
31+
export function createSecret(params: {
3232
userOptions: NextAuthOptions
3333
url: InternalUrl
3434
}) {
3535
const { userOptions, url } = params
3636

3737
return (
3838
userOptions.secret ??
39+
// TODO: Remove falling back to default secret, and error in dev if one isn't provided
3940
createHash("sha256")
4041
.update(JSON.stringify({ ...url, ...userOptions }))
4142
.digest("hex")

0 commit comments

Comments
 (0)