Implemented getCsrfToken as per auth-next docs, getCsrfToken is required by webpack5 (fixes #123, thanks @jacobocode)
This commit is contained in:
parent
ea31607598
commit
7b8d0b1119
1 changed files with 7 additions and 7 deletions
|
@ -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 })
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue