client/src/standalone/videos/shared/auth-http.ts
Function refreshFetch
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private refreshFetch (url: string, options?: RequestInit) {
return fetch(url, options)
.then((res: Response) => {
if (res.status !== HttpStatusCode.UNAUTHORIZED_401) return res
Function refreshingTokenPromise
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const refreshingTokenPromise = new Promise<void>((resolve, reject) => {
const clientId: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
const clientSecret: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
const headers = new Headers()