Add Logout call to signout (#221)

* Add Logout call to signout

* clean local storage even on error

---------

Co-authored-by: eglehelms <e.helms@cognigy.com>
This commit is contained in:
EgleHandeglehelms authored and GitHub committed 2023-03-29 08:54:17 -04:00
1 parent 7f93489580
commit f4d7880ab7
3 files changed
+30 -6

No files matched your search

+1
View File
@@ -189,6 +189,7 @@ export const CRED_NOT_TESTED = "not tested";
/** API base paths */
export const API_LOGIN = `${API_BASE_URL}/login`;
export const API_LOGOUT = `${API_BASE_URL}/logout`;
export const API_SBCS = `${API_BASE_URL}/Sbcs`;
export const API_USERS = `${API_BASE_URL}/Users`;
export const API_API_KEYS = `${API_BASE_URL}/ApiKeys`;
+5
View File
@@ -18,6 +18,7 @@ import {
API_SIP_GATEWAY,
API_PASSWORD_SETTINGS,
USER_ACCOUNT,
API_LOGOUT,
} from "./constants";
import { ROUTE_LOGIN } from "src/router/routes";
import {
@@ -233,6 +234,10 @@ export const postLogin = (payload: UserLoginPayload) => {
});
};
export const postLogout = () => {
return postFetch<undefined>(API_LOGOUT);
};
/** Named wrappers for `postFetch` */
export const postServiceProviders = (payload: Partial<ServiceProvider>) => {