add fallback for dropbox

This commit is contained in:
fyears
2022-03-05 22:32:58 +08:00
parent e2c4d158b1
commit b573b2859c
2 changed files with 119 additions and 13 deletions
+9 -2
View File
@@ -156,13 +156,20 @@ const fixLastModifiedTimeInplace = (allFilesFolders: RemoteItem[]) => {
// see https://dropbox.tech/developers/pkce--what-and-why-
////////////////////////////////////////////////////////////////////////////////
export const getAuthUrlAndVerifier = async (appKey: string) => {
export const getAuthUrlAndVerifier = async (
appKey: string,
needManualPatse: boolean = false
) => {
const auth = new DropboxAuth({
clientId: appKey,
});
const callback = needManualPatse
? undefined
: `obsidian://${COMMAND_CALLBACK_DROPBOX}`;
const authUrl = (
await auth.getAuthenticationUrl(
`obsidian://${COMMAND_CALLBACK_DROPBOX}`,
callback,
undefined,
"code",
"offline",