code-server/src/browser/pages/home.tsx

23 lines
567 B
TypeScript
Raw Normal View History

2020-02-05 02:27:46 +07:00
import * as React from "react"
import { RouteComponentProps } from "react-router"
import { authenticate } from "../api"
export const Home: React.FunctionComponent<RouteComponentProps> = (props) => {
React.useEffect(() => {
authenticate()
.then(() => {
// TEMP: Always redirect to VS Code.
props.history.push("./vscode/")
})
.catch(() => {
props.history.push("./login/")
})
}, [])
return (
<div className="orientation-guide">
<div className="welcome">Welcome to code-server.</div>
</div>
)
}