-
-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix next-auth integration * Create small-monkeys-battle.md * Update .changeset/small-monkeys-battle.md * add a postinstall script for good measure * add a postinstall script for good measure * fix lock file * upgrade pnpm * fix version * fix build error * suggessions * fix pnpm lock * fix pnpm lock * Update main.yml * Update apps/toolkit-app/next.config.js * next-auth working again * Update apps/toolkit-app/.env * Update packages/blitz-auth/src/server/auth-sessions.ts * Update packages/blitz-auth/src/server/auth-sessions.ts
- Loading branch information
1 parent
61888d1
commit b6b9a1c
Showing
11 changed files
with
74 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@blitzjs/auth": patch | ||
"blitz": patch | ||
--- | ||
|
||
Fix Next-Auth integration: `Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./passport/adapter" | ||
export * from "./next-auth/webpack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from "./next-auth/adapter" | ||
export * from "./next-auth/types" | ||
export * from "./next-auth/webpack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 20 additions & 8 deletions
28
packages/blitz-auth/src/server/adapters/next-auth/webpack.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
//@ts-nocheck | ||
import fs from "fs-extra" | ||
import path from "path" | ||
|
||
export function withNextAuthAdapter(nextConfig) { | ||
const config = Object.assign({}, nextConfig) | ||
config.webpack = (config) => { | ||
//add a required resolve alias | ||
config.resolve.alias["next-auth/core/lib/oauth/callback"] = | ||
process.cwd() + "/node_modules/next-auth/core/lib/oauth/callback.js" | ||
config.resolve.alias["next-auth/core/lib/oauth/authorization-url"] = | ||
process.cwd() + "/node_modules/next-auth/core/lib/oauth/authorization-url.js" | ||
config.resolve.alias["next-auth/core/init"] = | ||
process.cwd() + "/node_modules/next-auth/core/init.js" | ||
const nextAuthPath = path.dirname(require.resolve("next-auth")) | ||
const webpack = (config) => { | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
"next-auth/core/lib/oauth/callback": path.join(nextAuthPath, "core/lib/oauth/callback.js"), | ||
"next-auth/core/lib/oauth/authorization-url": path.join( | ||
nextAuthPath, | ||
"core/lib/oauth/authorization-url.js", | ||
), | ||
"next-auth/core/init": path.join(nextAuthPath, "core/init.js"), | ||
} | ||
return config | ||
} | ||
if (typeof nextConfig.webpack === "function") { | ||
config.webpack = (config, options) => { | ||
return nextConfig.webpack(webpack(config), options) | ||
} | ||
} | ||
config.webpack = webpack | ||
return config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.