Compare commits

...

3 Commits

Author SHA1 Message Date
6b4b511d66 fix: error 2025-10-01 10:11:56 +07:00
9dabbd60ea fix: handle submit 2025-10-01 10:11:30 +07:00
ba0b145bda update: credentials true 2025-10-01 10:11:20 +07:00
3 changed files with 7 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ const RegistrationRequest = async ({ method, prefix, params, headers = {} }) =>
'Accept-Language': 'en_US',
...headers,
},
// withCredentials: true,
withCredentials: true,
});
return response.data || {};

View File

@@ -40,15 +40,15 @@ const SignIn = () => {
password: values.password,
captcha: values.captcha,
captchaText: captchaText,
}
},
withCredentials: true
});
const user = res?.data?.user || res?.user;
const tokens = res?.data?.tokens || res?.tokens;
const accessToken = res?.data?.accessToken || res?.tokens?.accessToken;
if (user && tokens?.accessToken) {
localStorage.setItem('token', tokens.accessToken);
localStorage.setItem('refreshToken', tokens.refreshToken);
if (user && accessToken) {
localStorage.setItem('token', accessToken);
localStorage.setItem('user', JSON.stringify(user));
NotifOk({

View File

@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Card, Typography, Flex } from 'antd';
import { ReactSVG } from 'react-svg';
// import { ReactSVG } from 'react-svg';
import { setValSvg } from '../../components/Global/MqttConnection';
const { Text } = Typography;