fix(striker-ui): apply withCredentials to all API requests

main
Tsu-ba-me 2 years ago
parent 8d343e5cca
commit 4dece7aaf8
  1. 6
      striker-ui/components/GatePanel.tsx
  2. 1
      striker-ui/lib/api.ts

@ -28,11 +28,7 @@ const GatePanel: FC = () => {
setIsSubmitting(true); setIsSubmitting(true);
api api
.post( .post('/auth/login', { username, password })
'/auth/login',
{ username, password },
{ withCredentials: true },
)
.then(() => { .then(() => {
const url = returnTo ? String(returnTo) : '/'; const url = returnTo ? String(returnTo) : '/';

@ -7,6 +7,7 @@ const api = new Axios({
transformRequest: axios.defaults.transformRequest, transformRequest: axios.defaults.transformRequest,
transformResponse: axios.defaults.transformResponse, transformResponse: axios.defaults.transformResponse,
validateStatus: (status) => status < 400, validateStatus: (status) => status < 400,
withCredentials: true,
}); });
export default api; export default api;

Loading…
Cancel
Save