admin page
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||||
<script type="module" crossorigin src="/assets/index-CELGNVNm.js"></script>
|
<script type="module" crossorigin src="/assets/index-BFYBIKDe.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CVaTO0Sb.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CVaTO0Sb.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ export function useAdminLogin() {
|
|||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: adminLogin,
|
mutationFn: adminLogin,
|
||||||
onSuccess: () => {
|
onSuccess: (data) => {
|
||||||
queryClient.invalidateQueries({ queryKey: ADMIN_AUTH_QUERY_KEY })
|
// The token is already stored by adminLogin; write it straight into the
|
||||||
|
// gate's query cache so we flip to "authenticated" without re-hitting /refresh.
|
||||||
|
queryClient.setQueryData(ADMIN_AUTH_QUERY_KEY, data.access_token)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ export function useAdminLogout() {
|
|||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: adminLogout,
|
mutationFn: adminLogout,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries({ queryKey: ADMIN_AUTH_QUERY_KEY })
|
// Flip the gate back to "not authenticated" without triggering a /refresh refetch.
|
||||||
|
queryClient.setQueryData(ADMIN_AUTH_QUERY_KEY, null)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user