Merge pull request #124 from emrysal/bugfix/fix-nextauth-webpack5

csrfToken->getCsrfToken is required by webpack5 (fixes #123, thanks @jacobocode)
This commit is contained in:
Bailey Pumfleet 2021-05-01 09:19:21 +01:00 committed by GitHub
commit bf672280fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import Head from 'next/head';
import { csrfToken } from 'next-auth/client';
import { getCsrfToken } from 'next-auth/client';
export default function Login({ csrfToken }) {
return (
@ -48,8 +48,8 @@ export default function Login({ csrfToken }) {
)
}
Login.getInitialProps = async (context) => {
Login.getInitialProps = async ({ req, res }) => {
return {
csrfToken: await csrfToken(context)
csrfToken: await getCsrfToken({ req })
}
}