mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#21: support /oauth2/v1 on frontend
This commit is contained in:
@@ -56,7 +56,7 @@ describe('components/auth/actions', () => {
|
||||
request.get.returns(Promise.resolve(resp));
|
||||
|
||||
return callThunk(oAuthValidate, oauthData).then(() => {
|
||||
sinon.assert.calledWith(request.get, '/api/oauth/validate');
|
||||
sinon.assert.calledWith(request.get, '/api/oauth2/v1/validate');
|
||||
sinon.assert.calledWith(dispatch, setClient(resp.client));
|
||||
sinon.assert.calledWith(dispatch, setOAuthRequest(resp.oAuth));
|
||||
sinon.assert.calledWith(dispatch, setScopes(resp.session.scopes));
|
||||
@@ -83,7 +83,7 @@ describe('components/auth/actions', () => {
|
||||
request.post.returns(Promise.resolve(resp));
|
||||
|
||||
return callThunk(oAuthComplete).then(() => {
|
||||
sinon.assert.calledWithMatch(request.post, /\/api\/oauth\/complete/);
|
||||
sinon.assert.calledWithMatch(request.post, /\/api\/oauth2\/v1\/complete/);
|
||||
sinon.assert.calledWith(dispatch, setOAuthCode({
|
||||
success: true,
|
||||
code: '123',
|
||||
|
@@ -96,7 +96,7 @@ describe('AuthFlow.functional', () => {
|
||||
redirectUri: expectedRedirect
|
||||
})});
|
||||
|
||||
navigate('/oauth');
|
||||
navigate('/oauth2');
|
||||
|
||||
sinon.assert.calledThrice(flow.run);
|
||||
sinon.assert.calledWith(flow.run.getCall(0), 'oAuthValidate');
|
||||
|
@@ -176,7 +176,8 @@ describe('AuthFlow', () => {
|
||||
'/change-password': LoginState,
|
||||
'/oauth/permissions': LoginState,
|
||||
'/oauth/finish': LoginState,
|
||||
'/oauth': OAuthState,
|
||||
'/oauth2/v1': OAuthState,
|
||||
'/oauth2': OAuthState,
|
||||
'/register': RegisterState,
|
||||
'/recover-password': RecoverPasswordState,
|
||||
'/recover-password/key123': RecoverPasswordState,
|
||||
@@ -226,7 +227,7 @@ describe('AuthFlow', () => {
|
||||
});
|
||||
|
||||
it('should not handle the same request twice', () => {
|
||||
const path = '/oauth';
|
||||
const path = '/oauth2';
|
||||
const callback = sinon.stub();
|
||||
|
||||
flow.handleRequest(path, () => {}, callback);
|
||||
|
Reference in New Issue
Block a user