()
| 89 | } |
| 90 | |
| 91 | export 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 | |
| 102 | export function useUser() { |
| 103 | const [user, setUser] = useState(''); |
no test coverage detected