mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-25 19:14:00 +00:00
Enhancement: Add forgot password link to login form with instructions on how to properly reset a forgotten password.
This commit is contained in:
parent
575b764487
commit
b2a041c7c4
1 changed files with 56 additions and 0 deletions
|
|
@ -12,6 +12,9 @@ import {
|
|||
Image,
|
||||
Group,
|
||||
Divider,
|
||||
Modal,
|
||||
Anchor,
|
||||
Code,
|
||||
} from '@mantine/core';
|
||||
import logo from '../../assets/logo.png';
|
||||
|
||||
|
|
@ -23,6 +26,7 @@ const LoginForm = () => {
|
|||
|
||||
const navigate = useNavigate(); // Hook to navigate to other routes
|
||||
const [formData, setFormData] = useState({ username: '', password: '' });
|
||||
const [forgotPasswordOpened, setForgotPasswordOpened] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isAuthenticated) {
|
||||
|
|
@ -98,9 +102,61 @@ const LoginForm = () => {
|
|||
<Button type="submit" mt="sm" fullWidth>
|
||||
Login
|
||||
</Button>
|
||||
|
||||
<Group justify="flex-end">
|
||||
<Anchor
|
||||
size="sm"
|
||||
component="button"
|
||||
type="button"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
setForgotPasswordOpened(true);
|
||||
}}
|
||||
>
|
||||
Forgot password?
|
||||
</Anchor>
|
||||
</Group>
|
||||
</Stack>
|
||||
</form>
|
||||
</Paper>
|
||||
|
||||
<Modal
|
||||
opened={forgotPasswordOpened}
|
||||
onClose={() => setForgotPasswordOpened(false)}
|
||||
title="Reset Your Password"
|
||||
centered
|
||||
>
|
||||
<Stack spacing="md">
|
||||
<Text>
|
||||
To reset your password, your administrator needs to run a Django
|
||||
management command:
|
||||
</Text>
|
||||
<div>
|
||||
<Text weight={500} size="sm" mb={8}>
|
||||
If running with Docker:
|
||||
</Text>
|
||||
<Code block>
|
||||
docker exec <container_name> python manage.py changepassword
|
||||
<username>
|
||||
</Code>
|
||||
</div>
|
||||
<div>
|
||||
<Text weight={500} size="sm" mb={8}>
|
||||
If running locally:
|
||||
</Text>
|
||||
<Code block>python manage.py changepassword <username></Code>
|
||||
</div>
|
||||
<Text size="sm" color="dimmed">
|
||||
The command will prompt for a new password. Replace
|
||||
<code><container_name></code> with your Docker container name
|
||||
and <code><username></code> with the account username.
|
||||
</Text>
|
||||
<Text size="sm" color="dimmed" italic>
|
||||
Please contact your system administrator to perform a password
|
||||
reset.
|
||||
</Text>
|
||||
</Stack>
|
||||
</Modal>
|
||||
</Center>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue