MCPcopy Index your code
hub / github.com/Dispatcharr/Dispatcharr / checkSuperuser

Function checkSuperuser

frontend/src/App.jsx:64–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 superuserCheckStarted.current = true;
63
64 async function checkSuperuser() {
65 try {
66 const response = await API.fetchSuperUser();
67 if (response && response.superuser_exists === false) {
68 setSuperuserExists(false);
69 }
70 } catch (error) {
71 console.error('Error checking superuser status:', error);
72 // If authentication error, redirect to login
73 if (error.status === 401) {
74 localStorage.removeItem('token');
75 localStorage.removeItem('refreshToken');
76 window.location.href = '/login';
77 }
78 }
79 }
80 checkSuperuser();
81 }, [setSuperuserExists]);
82

Callers 1

AppFunction · 0.85

Calls 1

fetchSuperUserMethod · 0.80

Tested by

no test coverage detected