Hi everybody,
I’m trying to plug Instagram plugin on uppy but without success.
When I click on instagram I receive an error 401 Unauthorized, I probably did a mistake in my conf but i really don’t know where.
If someone could help me, it will be really appreciated
Client side
this.uppy = new Uppy({
id : 'uppy-input',
autoProceed : true,
debug : true,
restrictions : {
maxFileSize : 1000000,
maxNumberOfFiles : 1,
allowedFileTypes : ['image/*'],
},
})
.use(Webcam)
.use(Instagram, {
companionUrl : 'http://localhost:3000',
})
Server side
const app = express();
app.set('view engine', 'pug');
app.set('views', path.join(__dirname, 'views'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended : false }));
app.use(session({
secret : 'SECRET',
resave : false,
saveUninitialized : false,
cookie : { maxAge : null },
}));
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*')
res.setHeader(
'Access-Control-Allow-Methods',
'GET, POST, OPTIONS, PUT, PATCH, DELETE'
)
res.setHeader(
'Access-Control-Allow-Headers',
'Authorization, Origin, Content-Type, Accept'
)
res.setHeader('Access-Control-Allow-Credentials', 'true')
next()
})
app.use(compression());
app.use(flash());
const options = {
providerOptions : {
instagram : {
key : 'INSTA_KEY',
secret : 'INSTA_SECRET',
},
},
server : {
host : 'localhost:3000',
protocol : 'http',
},
filePath : '/public/js',
secret : 'mouhaiboafpastrop',
};
app.use(companion.app(options))
app.use('/api', routes.api);
app.use('/api/user', authentication, routes.user);
app.use('/', routes.app);
And I have one question, about Key in instagram option.
Do I have to create it by myself ? If not where is it ? And where it’s used in my app ?
Thanks