diff --git a/web/src/components/login.tsx b/web/src/components/login.tsx index 544e4c6..7d8bfcd 100644 --- a/web/src/components/login.tsx +++ b/web/src/components/login.tsx @@ -10,15 +10,13 @@ const getAuthCode = async (credentials: any) => axios.post('/SASjsApi/auth/authorize', credentials).then((res) => res.data) const login = async (payload: { username: string; password: string }) => - axios - .get('/form') - .then((res1) => - axios - .post('/login', payload, { - headers: { 'csrf-token': res1.data.csrfToken } - }) - .then((res2) => res2.data) - ) + axios.get('/form').then((res1) => + axios + .post('/login', payload, { + headers: { 'csrf-token': res1.data.csrfToken } + }) + .then((res2) => res2.data) + ) const Login = ({ getCodeOnly }: any) => { const location = useLocation()