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

Method refreshToken

frontend/src/api.js:193–209  ·  view source on GitHub ↗
(refresh)

Source from the content-addressed store, hash-verified

191 }
192
193 static async refreshToken(refresh) {
194 try {
195 return await request(`${host}/api/accounts/token/refresh/`, {
196 auth: false,
197 method: 'POST',
198 body: { refresh },
199 });
200 } catch (error) {
201 // If user does not exist or token is invalid, clear tokens
202 if (error.status === 401 || error.message?.includes('does not exist')) {
203 localStorage.removeItem('token');
204 localStorage.removeItem('refreshToken');
205 window.location.href = '/login'; // Redirect to login
206 }
207 throw error;
208 }
209 }
210
211 static async logout() {
212 return await request(`${host}/api/accounts/auth/logout/`, {

Callers 1

auth.jsxFile · 0.80

Calls 1

requestFunction · 0.85

Tested by

no test coverage detected