Skip to content
Snippets Groups Projects
Verified Commit 64780a00 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Suppress errors

parent c8b4d67b
No related branches found
No related tags found
2 merge requests!19Working email validation and hiding controller logic to InputField,!13Basic form api and implement cookie entrypoint
...@@ -10,6 +10,7 @@ export const App: FC = () => ( ...@@ -10,6 +10,7 @@ export const App: FC = () => (
<Switch> <Switch>
<Route path="/auth" component={AuthUser} /> <Route path="/auth" component={AuthUser} />
<Route exact path="/" component={LandingPage} /> <Route exact path="/" component={LandingPage} />
<Route exact path="/home" component={HomePage} />
</Switch> </Switch>
</div> </div>
</Router> </Router>
......
...@@ -7,10 +7,11 @@ export const AuthUser: FC = () => { ...@@ -7,10 +7,11 @@ export const AuthUser: FC = () => {
useEffect(() => { useEffect(() => {
axios axios
.get('api/web/csrf') .get('api/web/csrf')
.then((response) => .then((response) => {
sessionStorage.setItem('CSRF_TOKEN', response.data.token), // Check this https://stackoverflow.com/questions/39254562/csrf-with-django-reactredux-using-axios
) axios.defaults.headers.common['X-CSRFTOKEN'] = response.data.token;
.catch((error) => console.log(error)); })
.catch((error) => error);
}, []); }, []);
return ( return (
<Container maxWidth="sm"> <Container maxWidth="sm">
......
import React, { FC, useEffect } from 'react'; import React, { FC } from 'react';
export const LandingPage: FC = () => ( export const LandingPage: FC = () => (
<> <>
......
import React, { FC, useEffect } from 'react'; import React, { FC } from 'react';
export const TeamPage: FC = () => ( export const TeamPage: FC = () => (
<> <>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment