We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No response
Hi,
First of all I have been using Uppy for years and thank you so much for this wonderful tool.
I am using Uppy with React and Companion with the following versions
// client "@uppy/core": "^4.4.3", "@uppy/dashboard": "^4.0.3", "@uppy/google-drive-picker": "^0.3.3", // server "@uppy/companion": "^5.5.2",
import { Injectable, OnModuleInit, Logger } from '@nestjs/common' import companion = require('@uppy/companion') import fs from 'fs' @Injectable() export class UppyService implements OnModuleInit { private logger = new Logger('UppyService') private companionServer onModuleInit() { this.initializeCompanionServer() } async handleCompanion(req, res) { return this.companionServer.app.handle(req, res) } private initializeCompanionServer() { const dir = './tmp' if (!fs.existsSync(dir)) { fs.mkdirSync(dir) } this.logger.verbose(`Initializing Companion Server.`) const options = { providerOptions: { instagram: { key: process.env.INSTAGRAM_KEY, secret: process.env.INSTAGRAM_SECRET, }, drive: { key: process.env.GOOGLE_DRIVE_KEY, secret: process.env.GOOGLE_DRIVE_SECRET, }, facebook: { key: process.env.FACEBOOK_KEY, secret: process.env.FACEBOOK_SECRET, }, dropbox: { key: process.env.DROPBOX_KEY, secret: process.env.DROPBOX_SECRET, }, }, server: { host: process.env.HOST, protocol: process.env.PROTOCOL, path: '/api/image/companion', }, uploadUrls: ['/api/image/upload'], filePath: 'tmp/', secret: process.env.SESSION_SECRET, debug: true, corsOrigins: true, enableGooglePickerEndpoint: true, } this.companionServer = companion.app(options) } }
const instance = new Uppy({ id, autoProceed: true, locale: "en", debug: true, logger: debugLogger, allowMultipleUploads: false, restrictions: { maxFileSize: MAX_FILE_SIZE, maxNumberOfFiles: 1, allowedFileTypes: ["image/*"], }, }) .use(XHRUpload, { endpoint: `${process.env.NEXT_PUBLIC_API_URL}/image/upload`, }) .use(Webcam) .use(Dropbox, { companionUrl: COMPANION_URL, }) .use(Facebook, { companionUrl: COMPANION_URL, }) .use(GoogleDrivePicker, { companionUrl: COMPANION_URL, clientId: process.env.NEXT_PUBLIC_GOOGLE_DRIVE_CLIENT_ID, apiKey: process.env.NEXT_PUBLIC_GOOGLE_DRIVE_API_KEY, appId: process.env.NEXT_PUBLIC_GOOGLE_DRIVE_APP_ID, }) .on("restriction-failed", (event) => { if (event.size > MAX_FILE_SIZE) { errorToast(t("fileTooBig", { max: MAX_FILE_SIZE * 0.000001 })); } }) .on("upload-success", (file, response) => { client .get(`/image/tmp/get/${response.body.url}`, { responseType: "blob", }) .then((res) => { const reader = new FileReader(); reader.onload = function (e) { if (onSuccess) onSuccess(); }; reader.readAsDataURL(res.data); }) .catch(() => { if (onError) onError(); instance.cancelAll(); errorToast(t("uploadFailed")); }); });
I should be able to authenticate OAuth provider and upload files from them
Every http calls to API_URL/companion/PROVIDER/** are throwing this error blocking every interaction with providers
I have the issue using any provider, Google Drive, DropBox, etc
TypeError: Cannot read properties of undefined (reading 'uppyAuthToken')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Initial checklist
Link to runnable example
No response
Steps to reproduce
Hi,
First of all I have been using Uppy for years and thank you so much for this wonderful tool.
I am using Uppy with React and Companion with the following versions
My companion service
My uppy instance client side
Expected behavior
I should be able to authenticate OAuth provider and upload files from them
Actual behavior
Every http calls to API_URL/companion/PROVIDER/** are throwing this error blocking every interaction with providers
I have the issue using any provider, Google Drive, DropBox, etc
TypeError: Cannot read properties of undefined (reading 'uppyAuthToken')
The text was updated successfully, but these errors were encountered: