mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-18 20:04:17 +01:00
fixes and remove unused
This commit is contained in:
parent
b2a52eca79
commit
a4fd02bc58
@ -10,7 +10,6 @@ import { useAuth } from '../../auth/UseSession';
|
||||
|
||||
interface FirstLoginModalProps {
|
||||
opened: boolean;
|
||||
onPasswordChanged: () => void;
|
||||
username: string;
|
||||
}
|
||||
|
||||
@ -20,7 +19,7 @@ interface FirstLoginModalProps {
|
||||
* Forces first-time users to change their password.
|
||||
* Cannot be dismissed until password is successfully changed.
|
||||
*/
|
||||
export default function FirstLoginModal({ opened, onPasswordChanged, username }: FirstLoginModalProps) {
|
||||
export default function FirstLoginModal({ opened, username }: FirstLoginModalProps) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { signOut } = useAuth();
|
||||
|
||||
@ -46,13 +46,6 @@ export default function Landing() {
|
||||
checkFirstLogin()
|
||||
}, [session, config])
|
||||
|
||||
const handlePasswordChanged = async () => {
|
||||
// After password change, backend logs out the user
|
||||
// Refresh session to detect logout and redirect to login
|
||||
setIsFirstLogin(false) // Close modal first
|
||||
await refreshSession()
|
||||
// The auth system will automatically redirect to login when session is null
|
||||
}
|
||||
|
||||
console.log('[Landing] State:', {
|
||||
pathname: location.pathname,
|
||||
@ -87,7 +80,6 @@ export default function Landing() {
|
||||
<>
|
||||
<FirstLoginModal
|
||||
opened={isFirstLogin}
|
||||
onPasswordChanged={handlePasswordChanged}
|
||||
username={username}
|
||||
/>
|
||||
<HomePage />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user