SHA256
Смена пароля работает: восстановить ротацию ключей
This commit is contained in:
+14
-1
@@ -1463,12 +1463,15 @@ function attachPageScrollToBottom(pageId, screen) {
|
||||
});
|
||||
}
|
||||
|
||||
let keyRotationRouteLock = false;
|
||||
|
||||
async function redirectToActiveKeyRotationIfNeeded() {
|
||||
if (!state.session.isAuthorized || state.session.isLocalDemo) return false;
|
||||
try {
|
||||
const rotation = await new KeyRotationClient(authService).status();
|
||||
const status = String(rotation?.rotationStatus || 'NONE');
|
||||
if (status !== 'NONE' && getRoute().pageId !== 'key-rotation-view') {
|
||||
keyRotationRouteLock = status !== 'NONE' && status !== 'COMPLETE';
|
||||
if (keyRotationRouteLock && getRoute().pageId !== 'key-rotation-view') {
|
||||
navigate('key-rotation-view');
|
||||
return true;
|
||||
}
|
||||
@@ -1479,6 +1482,11 @@ async function redirectToActiveKeyRotationIfNeeded() {
|
||||
}
|
||||
|
||||
function renderApp() {
|
||||
if (keyRotationRouteLock && state.session.isAuthorized && getRoute().pageId !== 'key-rotation-view') {
|
||||
// Нельзя покинуть начатую ротацию через browser back, прямую ссылку или меню.
|
||||
navigate('key-rotation-view');
|
||||
return;
|
||||
}
|
||||
syncTrackedRouteHistory(window.location.pathname || '/');
|
||||
const route = getRoute();
|
||||
if (state.session.isAuthorized) {
|
||||
@@ -1666,6 +1674,7 @@ async function init() {
|
||||
});
|
||||
|
||||
setSessionResetHandler(() => {
|
||||
keyRotationRouteLock = false;
|
||||
sessionRuntimeStarted = false;
|
||||
stopChannelsPrefetch();
|
||||
startConnectionMonitor();
|
||||
@@ -1677,6 +1686,10 @@ async function init() {
|
||||
navigate('start-view');
|
||||
});
|
||||
|
||||
window.addEventListener('shine-key-rotation-active', event => {
|
||||
keyRotationRouteLock = Boolean(event.detail?.active);
|
||||
});
|
||||
|
||||
setSessionAuthorizedHandler(() => {
|
||||
void ensureSessionRuntimeStarted();
|
||||
void processPendingCallPushActionIfPossible();
|
||||
|
||||
Reference in New Issue
Block a user