Closed lunaris closed 1 year ago
Just ran into this same issue. For some reason it's not attaching scopes correctly.
Currently working my way around it.
const scopes = ['sales_invoices', 'documents', 'bank', 'time_entries', 'settings'];
const baseAuthUrl = await moneybirdAuthClient.authorizationCode.getAuthorizeUri({
redirectUri: `${protocol}//${host}${callback_path}`,
state: 'my-string',
scope: scopes
});
// Misses scopes
console.log('base', baseAuthUrl);
// Has scopes
const authUrl = `${baseAuthUrl}&scope=${scopes.join(' ')}`;
console.log(authUrl);
I must have originally missed this! I'm gonna cut a new build right now
Just released 2.0.18 which should fix this!
I'm currently trying to get authorization code flows to work with 2.0.17. This version is supposed to include a fix for passing
scope
correctly, but despite this my code is still not working. Upon digging intonode_modules
, it looks like thesrc
folder contains the correct code, but thedist
folder's built code does not correspond to it (and is thus missing the fixes required to getscope
to work):Can anyone else reproduce this? I don't think it's just my setup -- the "Code" tab on npmjs.com seems to confirm that
dist
andsrc
are out of sync in the packaged version of 2.0.17 (https://www.npmjs.com/package/@badgateway/oauth2-client?activeTab=explore). Cloning the repository and runningnpm install && make build
produces correct artifacts, so perhaps something went wrong with the release?Thanks for the great library and any time you are able to give to this!