closes#176@20m
[DEB]: debug expired access token and handle refresh token to navigate to the login page
This commit is contained in:
parent
b5203e6ac2
commit
c9a25069d8
@ -1,5 +1,5 @@
|
|||||||
VITE_API_ORIGIN = https://admin.dev.dipal.ru/api/v1
|
VITE_API_ORIGIN=https://admin.dev.dipal.ru/api/v1
|
||||||
VITE_API_AUTH_ORIGIN = https://auth.dev.dipal.ru/api/v1/auth
|
VITE_API_AUTH_ORIGIN=https://auth.dev.dipal.ru/api/v1/auth
|
||||||
VITE_API_AUTH_PHONENUMBER = /start-challenge
|
VITE_API_AUTH_PHONENUMBER = /start-challenge
|
||||||
VITE_API_AUTH_LOGIN = /login
|
VITE_API_AUTH_LOGIN = /login
|
||||||
VITE_API_AUTH_REFRESH = /refresh-token
|
VITE_API_AUTH_REFRESH = /refresh-token
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
VITE_API_ORIGIN = https://admin.dev.dipal.ru/api/v1
|
VITE_API_ORIGIN=https://admin.dev.dipal.ru/api/v1
|
||||||
VITE_API_AUTH_ORIGIN = https://auth.dev.dipal.ru/api/v1/auth
|
VITE_API_AUTH_ORIGIN=https://auth.dev.dipal.ru/api/v1/auth
|
||||||
VITE_API_AUTH_PHONENUMBER = /start-challenge
|
VITE_API_AUTH_PHONENUMBER=/start-challenge
|
||||||
VITE_API_AUTH_LOGIN = /login
|
VITE_API_AUTH_LOGIN=/login
|
||||||
VITE_API_AUTH_REFRESH = /refresh-token
|
VITE_API_AUTH_REFRESH=/refresh-token
|
||||||
VITE_API_CREATE_MEMBER = /user_place/members
|
VITE_API_CREATE_MEMBER=/user_place/members
|
||||||
VITE_API_PLACES = /place
|
VITE_API_PLACES=/place
|
||||||
VITE_API_USERS = /profile
|
VITE_API_USERS=/profile
|
||||||
VITE_API_USERS_ACCOUNT = /account
|
VITE_API_USERS_ACCOUNT=/account
|
||||||
VITE_API_USERS_PROFILE = /profile
|
VITE_API_USERS_PROFILE=/profile
|
||||||
VITE_API_QR = /qr_code
|
VITE_API_QR=/qr_code
|
@ -2,9 +2,9 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite + React + TS</title>
|
<title>Dipal admin panel</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
14
public/logo.svg
Normal file
14
public/logo.svg
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<svg width="445" height="186" viewBox="0 0 445 186" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect x="118.419" y="4.99276" width="56.5023" height="56.5023" rx="28.2512" fill="url(#paint0_linear_10465_270914)" stroke="white" stroke-width="8.01452"/>
|
||||||
|
<path d="M47.4671 183.432H0.200012V50.0942H47.8577C61.2696 50.0942 72.8151 52.7636 82.4942 58.1023C92.1733 63.3976 99.6172 71.015 104.826 80.9545C110.078 90.8941 112.703 102.787 112.703 116.633C112.703 130.522 110.078 142.458 104.826 152.441C99.6172 162.424 92.1299 170.085 82.364 175.424C72.6415 180.762 61.0092 183.432 47.4671 183.432ZM28.391 159.277H46.2952C54.6288 159.277 61.6385 157.802 67.3245 154.85C73.0538 151.855 77.3508 147.233 80.2155 140.982C83.1236 134.689 84.5776 126.572 84.5776 116.633C84.5776 106.78 83.1236 98.7285 80.2155 92.4783C77.3508 86.2281 73.0755 81.6273 67.3896 78.6758C61.7036 75.7243 54.6939 74.2486 46.3603 74.2486H28.391V159.277Z" fill="white"/>
|
||||||
|
<path d="M133.065 183.432V83.4286H160.801V183.432H133.065Z" fill="white"/>
|
||||||
|
<path d="M195.415 183.432V50.0942H248.021C258.134 50.0942 266.75 52.0257 273.868 55.8887C280.987 59.7082 286.412 65.0252 290.145 71.8397C293.921 78.6107 295.809 86.4235 295.809 95.2779C295.809 104.132 293.899 111.945 290.08 118.716C286.26 125.487 280.726 130.761 273.478 134.537C266.273 138.313 257.548 140.201 247.305 140.201H213.775V117.609H242.748C248.173 117.609 252.644 116.676 256.16 114.81C259.719 112.9 262.366 110.274 264.103 106.932C265.882 103.546 266.772 99.6617 266.772 95.2779C266.772 90.8507 265.882 86.9877 264.103 83.689C262.366 80.3469 259.719 77.7643 256.16 75.9414C252.6 74.075 248.086 73.1418 242.617 73.1418H223.606V183.432H195.415Z" fill="white"/>
|
||||||
|
<path d="M339.43 185.32C333.05 185.32 327.364 184.213 322.373 181.999C317.381 179.742 313.431 176.422 310.523 172.038C307.659 167.611 306.226 162.099 306.226 155.501C306.226 149.945 307.246 145.279 309.286 141.503C311.326 137.727 314.104 134.689 317.62 132.388C321.136 130.088 325.129 128.352 329.599 127.18C334.113 126.008 338.844 125.183 343.792 124.706C349.609 124.098 354.296 123.534 357.855 123.013C361.415 122.449 363.997 121.624 365.603 120.539C367.209 119.454 368.012 117.848 368.012 115.721V115.331C368.012 111.207 366.71 108.017 364.106 105.76C361.545 103.503 357.899 102.374 353.168 102.374C348.176 102.374 344.205 103.481 341.253 105.695C338.302 107.865 336.349 110.6 335.394 113.898L309.742 111.815C311.044 105.738 313.605 100.486 317.424 96.0592C321.244 91.5885 326.17 88.1596 332.204 85.7724C338.28 83.3418 345.312 82.1265 353.298 82.1265C358.854 82.1265 364.171 82.7775 369.249 84.0796C374.371 85.3818 378.906 87.4001 382.856 90.1345C386.849 92.869 389.996 96.3847 392.297 100.682C394.597 104.935 395.747 110.035 395.747 115.982V183.432H369.444V169.564H368.663C367.057 172.689 364.909 175.445 362.217 177.833C359.526 180.176 356.293 182.021 352.517 183.367C348.741 184.669 344.378 185.32 339.43 185.32ZM347.373 166.179C351.453 166.179 355.056 165.376 358.181 163.77C361.306 162.12 363.758 159.907 365.538 157.129C367.317 154.351 368.207 151.204 368.207 147.688V137.076C367.339 137.64 366.146 138.161 364.626 138.639C363.151 139.073 361.48 139.485 359.613 139.876C357.747 140.223 355.881 140.548 354.014 140.852C352.148 141.113 350.455 141.351 348.936 141.568C345.681 142.046 342.838 142.805 340.407 143.847C337.976 144.889 336.088 146.299 334.743 148.079C333.397 149.815 332.724 151.985 332.724 154.59C332.724 158.366 334.092 161.252 336.826 163.249C339.604 165.202 343.12 166.179 347.373 166.179Z" fill="white"/>
|
||||||
|
<path d="M445 50.0942V183.432H417.265V50.0942H445Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_10465_270914" x1="146.67" y1="9.00002" x2="146.67" y2="57.4878" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#0092DF"/>
|
||||||
|
<stop offset="1" stop-color="#003EDF"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
Before Width: | Height: | Size: 1.5 KiB |
@ -69,12 +69,11 @@ export class HTTPPovider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private responseIncepter(axiosInstance: AxiosInstance) {
|
private responseIncepter(axiosInstance: AxiosInstance) {
|
||||||
axiosInstance.interceptors.response.use(
|
return axiosInstance.interceptors.response.use(
|
||||||
(response) => response,
|
(response) => response,
|
||||||
(error) => {
|
(error) => {
|
||||||
const originalRequest = error.config;
|
const originalRequest = error.config;
|
||||||
|
if (error.response.status === 401 && error.response.data.message === 'Unauthorized') {
|
||||||
if (error.response.status === 401 && error.response.message === 'Unauthorized') {
|
|
||||||
const newAccessToken = this.refreshAccessToken().then(() => {
|
const newAccessToken = this.refreshAccessToken().then(() => {
|
||||||
originalRequest.headers.Authorization = `Bearer ${newAccessToken}`;
|
originalRequest.headers.Authorization = `Bearer ${newAccessToken}`;
|
||||||
return axios(originalRequest);
|
return axios(originalRequest);
|
||||||
|
@ -4,7 +4,7 @@ import Loading from '~/driven/utils/components/loading/Loading';
|
|||||||
import TableRow from '../../common/table-row';
|
import TableRow from '../../common/table-row';
|
||||||
import { IPlacesListProps } from './protocols';
|
import { IPlacesListProps } from './protocols';
|
||||||
|
|
||||||
export default function UsersListView(props: IPlacesListProps) {
|
export default function PlacesListView(props: IPlacesListProps) {
|
||||||
const { selectedRowId, setSelectedRowId, placesList } = props;
|
const { selectedRowId, setSelectedRowId, placesList } = props;
|
||||||
|
|
||||||
const rows = useMemo(() => {
|
const rows = useMemo(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user