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

Replace fetch with axios

parent 4f196392
No related branches found
No related tags found
2 merge requests!16Axios,!13Basic form api and implement cookie entrypoint
import React, { FC, useEffect } from 'react';
import axios from 'axios';
import Container from '@material-ui/core/Container';
import { SignInForm } from './SignInForm/SignInForm';
export const AuthUser: FC = () => {
useEffect(() => {
fetch('/api/web/csrf')
.then((response) => response.json())
.then((data) => sessionStorage.setItem('token', data.token));
axios
.get('api/web/csrf')
.then((response) => console.log(response))
.catch((error) => console.log(error));
}, []);
return (
<Container maxWidth="sm">
......
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