MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / logout

Function logout

src/Data/UserData.js:91–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91export async function logout() {
92 const response = await authRequest(LOGOUT);
93 if (response.status !== 200 && response.status !== 401) {
94 const content = await response.json();
95 alert(`${content.error}, Error code: ${response.status}`);
96 }
97 await emptyCache();
98 notifyUserChanged();
99 return redirect("/login");
100}
101
102export function useUser() {
103 const [user, setUser] = useState('');

Callers 1

actionFunction · 0.90

Calls 3

emptyCacheFunction · 0.90
authRequestFunction · 0.85
notifyUserChangedFunction · 0.85

Tested by

no test coverage detected