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

Implement cookie fetch with axios

parent 02697e68
No related branches found
No related tags found
2 merge requests!18Api login,!13Basic form api and implement cookie entrypoint
...@@ -7,7 +7,9 @@ export const AuthUser: FC = () => { ...@@ -7,7 +7,9 @@ export const AuthUser: FC = () => {
useEffect(() => { useEffect(() => {
axios axios
.get('api/web/csrf') .get('api/web/csrf')
.then((response) => console.log(response)) .then((response) =>
sessionStorage.setItem('CSRF_TOKEN', response.data.token),
)
.catch((error) => console.log(error)); .catch((error) => console.log(error));
}, []); }, []);
return ( return (
......
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