fix: handle token expiry (#3847)
This commit is contained in:
11
packages/netlify-cms-lib-util/src/AccessTokenError.ts
Normal file
11
packages/netlify-cms-lib-util/src/AccessTokenError.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export const ACCESS_TOKEN_ERROR = 'ACCESS_TOKEN_ERROR';
|
||||
|
||||
export default class AccessTokenError extends Error {
|
||||
message: string;
|
||||
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
this.name = ACCESS_TOKEN_ERROR;
|
||||
}
|
||||
}
|
@ -84,6 +84,8 @@ export type Config = {
|
||||
large_media_url?: string;
|
||||
use_large_media_transforms_in_media_library?: boolean;
|
||||
proxy_url?: string;
|
||||
auth_type?: string;
|
||||
app_id?: string;
|
||||
};
|
||||
media_folder: string;
|
||||
base_url?: string;
|
||||
@ -139,6 +141,7 @@ export interface Implementation {
|
||||
) => Promise<{ entries: ImplementationEntry[]; cursor: Cursor }>;
|
||||
|
||||
isGitBackend?: () => boolean;
|
||||
status: () => Promise<{ auth: boolean }>;
|
||||
}
|
||||
|
||||
const MAX_CONCURRENT_DOWNLOADS = 10;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import APIError from './APIError';
|
||||
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from './Cursor';
|
||||
import EditorialWorkflowError, { EDITORIAL_WORKFLOW_ERROR } from './EditorialWorkflowError';
|
||||
import AccessTokenError from './AccessTokenError';
|
||||
import localForage from './localForage';
|
||||
import { isAbsolutePath, basename, fileExtensionWithSeparator, fileExtension } from './path';
|
||||
import { onlySuccessfulPromises, flowAsync, then } from './promise';
|
||||
@ -138,6 +139,7 @@ export const NetlifyCmsLibUtil = {
|
||||
blobToFileObj,
|
||||
requestWithBackoff,
|
||||
allEntriesByFolder,
|
||||
AccessTokenError,
|
||||
};
|
||||
export {
|
||||
APIError,
|
||||
@ -192,4 +194,5 @@ export {
|
||||
blobToFileObj,
|
||||
requestWithBackoff,
|
||||
allEntriesByFolder,
|
||||
AccessTokenError,
|
||||
};
|
||||
|
Reference in New Issue
Block a user