提交 95c2e57e 编写于 作者: T takehiro 提交者: Luis Alvarez D

with cookie auth latest (#10005)

上级 abc0b071
import Link from 'next/link'
import { logout } from '../utils/auth'
const Header = props => (
const Header = () => (
<header>
<nav>
<ul>
......
......@@ -3,7 +3,7 @@ import Head from 'next/head'
import Header from './header'
const Layout = props => (
<React.Fragment>
<>
<Head>
<title>With Cookies</title>
</Head>
......@@ -34,7 +34,7 @@ const Layout = props => (
<main>
<div className="container">{props.children}</div>
</main>
</React.Fragment>
</>
)
export default Layout
......@@ -6,11 +6,11 @@
"start": "next start"
},
"dependencies": {
"isomorphic-unfetch": "^3.0.0",
"js-cookie": "^2.2.0",
"next": "^9.0.1",
"next-cookies": "^1.0.4",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"isomorphic-unfetch": "latest",
"js-cookie": "latest",
"next": "latest",
"next-cookies": "latest",
"react": "latest",
"react-dom": "latest"
}
}
......@@ -3,10 +3,10 @@ import fetch from 'isomorphic-unfetch'
import Layout from '../components/layout'
import { login } from '../utils/auth'
function Login() {
const Login = () => {
const [userData, setUserData] = useState({ username: '', error: '' })
async function handleSubmit(event) {
const handleSubmit = async event => {
event.preventDefault()
setUserData(Object.assign({}, userData, { error: '' }))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册