Do not log out current user (#4291)
This commit is contained in:
parent
0659324b60
commit
e57c8f3eb3
2 changed files with 5 additions and 10 deletions
|
@ -76,11 +76,4 @@ describe("Sessions test", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("logout all sessions", () => {
|
|
||||||
it("logout all sessions", () => {
|
|
||||||
sessionsPage.logoutAllSessions();
|
|
||||||
cy.get("#kc-page-title").contains("Sign in to your account");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,9 @@ import "./SessionsSection.css";
|
||||||
export default function SessionsSection() {
|
export default function SessionsSection() {
|
||||||
const { t } = useTranslation("sessions");
|
const { t } = useTranslation("sessions");
|
||||||
|
|
||||||
const { keycloak, adminClient } = useAdminClient();
|
const { adminClient } = useAdminClient();
|
||||||
|
const [key, setKey] = useState(0);
|
||||||
|
const refresh = () => setKey(key + 1);
|
||||||
const { addError } = useAlerts();
|
const { addError } = useAlerts();
|
||||||
const { realm } = useRealm();
|
const { realm } = useRealm();
|
||||||
|
|
||||||
|
@ -58,7 +60,7 @@ export default function SessionsSection() {
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
try {
|
try {
|
||||||
await adminClient.realms.logoutAll({ realm });
|
await adminClient.realms.logoutAll({ realm });
|
||||||
keycloak.logout({ redirectUri: "" });
|
refresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addError("sessions:logoutAllSessionsError", error);
|
addError("sessions:logoutAllSessionsError", error);
|
||||||
}
|
}
|
||||||
|
@ -103,7 +105,7 @@ export default function SessionsSection() {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<SessionsTable loader={loader} />
|
<SessionsTable key={key} loader={loader} />
|
||||||
</PageSection>
|
</PageSection>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue