You are here

private function BackupMigrateDropboxAPI::get_refresh_token in Backup and Migrate Dropbox 7.3

Returns the refresh token for this Dropbox destination.

Return value

string The refresh token for this Dropbox destination.

Throws

RuntimeException

1 call to BackupMigrateDropboxAPI::get_refresh_token()
BackupMigrateDropboxAPI::refresh_bearer_token in ./backup_migrate_dropbox.dropbox_api.inc
Refreshes and returns an expired bearer token.

File

./backup_migrate_dropbox.dropbox_api.inc, line 191

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

private function get_refresh_token() {
  $refresh_token = $this->destination
    ->settings('refresh_token');
  if ($refresh_token === NULL) {
    $name = $this->destination
      ->get_name();
    $id = $this->destination
      ->get_id();
    $edit_destination_page = l('Edit destination page for this destination', "admin/config/system/backup_migrate/settings/destination/edit/{$id}");
    throw new RuntimeException("Dropbox Destination '{$name}' not authorized correctly: refresh token missing. Please visit the {$edit_destination_page} and configure it anew.");
  }
  return $refresh_token;
}