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 = () => (
<Switch>
<Route path="/auth" component={AuthUser} />
<Route exact path="/" component={LandingPage} />
<Route exact path="/home" component={HomePage} />
</Switch>
</div>
</Router>
......
......@@ -7,10 +7,11 @@ export const AuthUser: FC = () => {
useEffect(() => {
axios
.get('api/web/csrf')
.then((response) =>
sessionStorage.setItem('CSRF_TOKEN', response.data.token),
)
.catch((error) => console.log(error));
.then((response) => {
// Check this https://stackoverflow.com/questions/39254562/csrf-with-django-reactredux-using-axios
axios.defaults.headers.common['X-CSRFTOKEN'] = response.data.token;
})
.catch((error) => error);
}, []);
return (
<Container maxWidth="sm">
......
import React, { FC, useEffect } from 'react';
import React, { FC } from 'react';
export const LandingPage: FC = () => (
<>
......
import React, { FC, useEffect } from 'react';
import React, { FC } from 'react';
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