Implemented getCsrfToken as per auth-next docs, getCsrfToken is required by webpack5 (fixes #123, thanks @jacobocode)
parent
ea31607598
commit
7b8d0b1119
|
@ -1,5 +1,5 @@
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { csrfToken } from 'next-auth/client';
|
import { getCsrfToken } from 'next-auth/client';
|
||||||
|
|
||||||
export default function Login({ csrfToken }) {
|
export default function Login({ csrfToken }) {
|
||||||
return (
|
return (
|
||||||
|
@ -48,8 +48,8 @@ export default function Login({ csrfToken }) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Login.getInitialProps = async (context) => {
|
Login.getInitialProps = async ({ req, res }) => {
|
||||||
return {
|
return {
|
||||||
csrfToken: await csrfToken(context)
|
csrfToken: await getCsrfToken({ req })
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue