Skip to content

Commit 2034677

Browse files
committed
frontend: only logout current session when clicking the logout button in the navbar and add button to logout all sessions to user page.
1 parent 113dcc4 commit 2034677

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

frontend/src/components/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function CustomNavbar() {
5454
<Nav>
5555
<Nav.Link onClick={(e) => {
5656
e.preventDefault();
57-
logout(true);
57+
logout(false);
5858
}}>{t("logout")}</Nav.Link>
5959
</Nav>
6060
</Navbar.Collapse>

frontend/src/locales/de.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const de ={
1515
"close": "Schließen",
1616
"delete_user": "Account löschen",
1717
"password": "Passwort",
18-
"password_invalid": "Passwort falsch"
18+
"password_invalid": "Passwort falsch",
19+
"logout_all": "Von allen Geräten ausloggen"
1920
},
2021
"recovery": {
2122
"recovery": "Passwort zurücksetzen",

frontend/src/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const en = {
1515
"close": "Close",
1616
"delete_user": "Delete account",
1717
"password": "Password",
18-
"password_invalid": "Password is wrong"
18+
"password_invalid": "Password is wrong",
19+
"logout_all": "Logout from all devices"
1920
},
2021
"recovery": {
2122
"recovery": "Password recovery",

frontend/src/pages/user.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ export function User() {
249249
<Button variant="primary" className="col col-sm-6 col-md-4 col-lg-3 col-xl-2 mb-3" onClick={handleUpdatePasswordShow}>
250250
{t("change_password")}
251251
</Button>
252+
253+
<Button variant="primary" className="col col-sm-6 col-md-4 col-lg-3 col-xl-2 mb-3" onClick={() => logout(true)}>
254+
{t("logout_all")}
255+
</Button>
252256
<Button variant="danger" className="col col-sm-6 col-md-4 col-lg-3 col-xl-2" onClick={handleDeleteUserShow}>
253257
{t("delete_user")}
254258
</Button>

0 commit comments

Comments
 (0)