mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
auth reroute to tables view
This commit is contained in:
@@ -27,7 +27,7 @@ const App: React.FC = () => {
|
||||
<CustomBrowserRouter>
|
||||
<div>
|
||||
<Route exact path="/auth" component={AuthView} />
|
||||
<Route exact path="/" component={TablesView} />
|
||||
<PrivateRoute exact path="/" component={TablesView} />
|
||||
<PrivateRoute path="/table/" component={TableView} />
|
||||
</div>
|
||||
</CustomBrowserRouter>
|
||||
|
||||
@@ -7,6 +7,7 @@ import Button from "@material-ui/core/Button";
|
||||
import Typography from "@material-ui/core/Typography";
|
||||
import { maxWidth } from "@material-ui/system";
|
||||
import { googleProvider, auth } from "../firebase";
|
||||
import useRouter from "../hooks/useRouter";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
card: {
|
||||
@@ -22,13 +23,15 @@ const useStyles = makeStyles({
|
||||
}
|
||||
});
|
||||
|
||||
googleProvider.addScope("https://www.googleapis.com/auth/contacts.readonly");
|
||||
function handleAuth() {
|
||||
auth.signInWithPopup(googleProvider);
|
||||
}
|
||||
// googleProvider.addScope("https://www.googleapis.com/auth/contacts.readonly");
|
||||
|
||||
export default function AuthView() {
|
||||
const classes = useStyles();
|
||||
|
||||
const router = useRouter();
|
||||
const handleAuth = async () => {
|
||||
await auth.signInWithPopup(googleProvider);
|
||||
router.history.replace("/");
|
||||
};
|
||||
return (
|
||||
<Card className={classes.card}>
|
||||
<CardContent>
|
||||
|
||||
Reference in New Issue
Block a user