Fix the case when passed more than 2 scopes, delimited by comma

This commit is contained in:
ErickSkrauch 2019-12-15 16:38:13 +03:00
parent 7af08f3ed7
commit 0609815ac6
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ export default class OAuthState extends AbstractState {
redirectUrl: query.get('redirect_uri'),
responseType: query.get('response_type'),
description: query.get('description'),
scope: (query.get('scope') || '').replace(',', ' '),
scope: (query.get('scope') || '').replace(/,/g, ' '),
prompt: query.get('prompt'),
loginHint: query.get('login_hint'),
state: query.get('state')

View File

@ -123,7 +123,7 @@ describe('OAuthState', () => {
client_id: 'client_id',
redirect_uri: 'redirect_uri',
response_type: 'response_type',
scope: 'scope1,scope2',
scope: 'scope1,scope2,scope3',
state: 'state',
};
@ -138,7 +138,7 @@ describe('OAuthState', () => {
clientId: query.client_id,
redirectUrl: query.redirect_uri,
responseType: query.response_type,
scope: 'scope1 scope2',
scope: 'scope1 scope2 scope3',
state: query.state,
})
).returns({then() {}});