Skip to content

Commit

Permalink
Merge pull request #329 from amplimindcc/328-add-reset-password-to-lo…
Browse files Browse the repository at this point in the history
…gout-page

add reset password
  • Loading branch information
cwsyth authored Jun 10, 2024
2 parents bbe64e9 + 809d696 commit d016061
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
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>
);
}

0 comments on commit d016061

Please sign in to comment.