feat: improve operations diagnostics and channel management
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { adminApi, clientApi, type CaptchaResponse } from '@/api/adminApi';
|
||||
import { consumeSessionRecovery, readSessionRecovery, writeSession, type Portal } from '@/api/session';
|
||||
import { consumeSessionRecovery, markUserActivity, readSessionRecovery, writeSession, type Portal } from '@/api/session';
|
||||
import { Button, Input, Modal } from '@/components/ui';
|
||||
|
||||
type LoginPageProps = {
|
||||
@@ -57,6 +57,10 @@ export function LoginPage({ portal }: LoginPageProps) {
|
||||
captchaText,
|
||||
});
|
||||
writeSession(session);
|
||||
// A login can happen without a full page reload after the previous session
|
||||
// expired. Reset the in-memory activity clock so the new session is not
|
||||
// immediately locked using the previous session's stale idle duration.
|
||||
markUserActivity();
|
||||
const target = consumeSessionRecovery(portal)?.returnUrl;
|
||||
navigate(target ?? (isAdmin ? '/admin' : '/client'), { replace: true });
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user