// eslint-disable-next-line no-use-before-define import * as React from "react" import { signIn, signOut, useSession } from "next-auth/react" import Layout from "components/layout" export default function Page() { const [response, setResponse] = React.useState(null) const handleLogin = (options) => async () => { if (options.redirect) { return signIn("credentials", options) } const response = await signIn("credentials", options) setResponse(response) } const handleLogout = (options) => async () => { if (options.redirect) { return signOut(options) } const response = await signOut(options) setResponse(response) } const { data: session } = useSession() if (session) { return (

Test different flows for Credentials logout

Default:
No redirect:

Response:

          {JSON.stringify(response, null, 2)}
        
) } return (

Test different flows for Credentials login

Default:
No redirect:
No redirect, wrong password:

Response:

        {JSON.stringify(response, null, 2)}
      
) }