Compare commits

...

3 Commits

Author SHA1 Message Date
Gabrijel Gavranović
a2705fb5b9 fix(client): export getCsrfToken directly to support Webpack 5
Fixes `Attempted import error: 'getCsrfToken' is not exported from 'next-auth/client' (imported as 'getCsrfToken’).`-error.
2021-04-21 17:14:12 +02:00
Balázs Orbán
cb1e5a7174 docs(dev): add readme to dev app 2021-04-21 00:00:57 +02:00
Balázs Orbán
8cba5d06b5 build(provider): filter index.js to be more forgiving 2021-04-20 23:17:18 +02:00
3 changed files with 10 additions and 2 deletions

6
app/README.md Normal file
View File

@@ -0,0 +1,6 @@
# NextAuth.js Development App
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
[Setting up local environment
](https://github.com/nextauthjs/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)

View File

@@ -52,7 +52,9 @@ TYPES_TARGETS.forEach((target) => {
const providersDir = path.join(process.cwd(), "/src/providers")
const files = fs.readdirSync(providersDir, "utf8")
const files = fs
.readdirSync(providersDir, "utf8")
.filter((file) => file !== "index.js")
let importLines = ""
let exportLines = `export default {\n`

View File

@@ -145,7 +145,7 @@ export async function getSession (ctx) {
return session
}
async function getCsrfToken (ctx) {
export async function getCsrfToken (ctx) {
return (await _fetchData('csrf', ctx))?.csrfToken
}