Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reset password #329

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/locales/de/logout.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"logoutSuccessful": "Abmeldung erfolgreich",
"logoutError": "Abmeldung fehlgeschlagen: ",
"logoutButton": "Abmelden"
"logoutButton": "Abmelden",
"resetPassword": "Passwort zurücksetzen"
}
3 changes: 2 additions & 1 deletion src/locales/en/logout.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"logoutSuccessful": "Logout successful",
"logoutError": "Logout failed with: ",
"logoutButton": "Logout"
"logoutButton": "Logout",
"resetPassword": "Reset password"
}
4 changes: 4 additions & 0 deletions src/pages/Logout/Logout.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe('Logout', () => {

await screen.findByText(/logout successful/i);
});

test('reset password link is rendered', async () => {
await screen.findByRole('link', { name: /reset password/i });
})
});

afterEach(() => {
Expand Down
7 changes: 7 additions & 0 deletions src/pages/Logout/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useNavigate } from 'react-router-dom';
import { StatusCodes, getReasonPhrase } from 'http-status-codes';
import { useTranslation } from 'react-i18next';
import { useAuthenticatedContext } from '../../components/Context/AuthenticatedContext/useAuthenticatedContext';
import { Link } from 'react-router-dom';

/**
* Logout page
Expand Down Expand Up @@ -71,6 +72,12 @@ export default function Logout() {
<div className="logout center">
<h1>Logout</h1>
<Button text={t('logoutButton')} handleClick={logout} />
<Link
id="resetPassword"
to="/resetPasswordRequest"
>
{t('resetPassword')}
</Link>
</div>
);
}