Skip to content

Commit cde660e

Browse files
committed
Use long-lived refresh token for the Dropbox backend
The refresh token can be downloaded from https://duplicacy.com/dropbox_start
1 parent 54952ce commit cde660e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/duplicacy_dropboxstorage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ type DropboxStorage struct {
2121
}
2222

2323
// CreateDropboxStorage creates a dropbox storage object.
24-
func CreateDropboxStorage(accessToken string, storageDir string, minimumNesting int, threads int) (storage *DropboxStorage, err error) {
24+
func CreateDropboxStorage(refreshToken string, storageDir string, minimumNesting int, threads int) (storage *DropboxStorage, err error) {
2525

2626
var clients []*dropbox.Files
2727
for i := 0; i < threads; i++ {
28-
client := dropbox.NewFiles(dropbox.NewConfig(accessToken))
28+
client := dropbox.NewFiles(dropbox.NewConfig("", refreshToken, "https://duplicacy.com/dropbox_refresh"))
2929
clients = append(clients, client)
3030
}
3131

src/duplicacy_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor
540540

541541
} else if matched[1] == "dropbox" {
542542
storageDir := matched[3] + matched[5]
543-
token := GetPassword(preference, "dropbox_token", "Enter Dropbox access token:", true, resetPassword)
543+
token := GetPassword(preference, "dropbox_token", "Enter Dropbox refresh token:", true, resetPassword)
544544
dropboxStorage, err := CreateDropboxStorage(token, storageDir, 1, threads)
545545
if err != nil {
546546
LOG_ERROR("STORAGE_CREATE", "Failed to load the dropbox storage: %v", err)

0 commit comments

Comments
 (0)