Compare commits
3 Commits
b73abf2fa2
...
6b4b511d66
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b4b511d66 | |||
| 9dabbd60ea | |||
| ba0b145bda |
@@ -12,7 +12,7 @@ const RegistrationRequest = async ({ method, prefix, params, headers = {} }) =>
|
|||||||
'Accept-Language': 'en_US',
|
'Accept-Language': 'en_US',
|
||||||
...headers,
|
...headers,
|
||||||
},
|
},
|
||||||
// withCredentials: true,
|
withCredentials: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
return response.data || {};
|
return response.data || {};
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ const SignIn = () => {
|
|||||||
password: values.password,
|
password: values.password,
|
||||||
captcha: values.captcha,
|
captcha: values.captcha,
|
||||||
captchaText: captchaText,
|
captchaText: captchaText,
|
||||||
}
|
},
|
||||||
|
withCredentials: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = res?.data?.user || res?.user;
|
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) {
|
if (user && accessToken) {
|
||||||
localStorage.setItem('token', tokens.accessToken);
|
localStorage.setItem('token', accessToken);
|
||||||
localStorage.setItem('refreshToken', tokens.refreshToken);
|
|
||||||
localStorage.setItem('user', JSON.stringify(user));
|
localStorage.setItem('user', JSON.stringify(user));
|
||||||
|
|
||||||
NotifOk({
|
NotifOk({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Card, Typography, Flex } from 'antd';
|
import { Card, Typography, Flex } from 'antd';
|
||||||
import { ReactSVG } from 'react-svg';
|
// import { ReactSVG } from 'react-svg';
|
||||||
import { setValSvg } from '../../components/Global/MqttConnection';
|
import { setValSvg } from '../../components/Global/MqttConnection';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|||||||
Reference in New Issue
Block a user