accounts-frontend/src/services/authFlow/OAuthState.js

20 lines
671 B
JavaScript
Raw Normal View History

2016-03-02 02:06:14 +05:30
import AbstractState from './AbstractState';
import CompleteState from './CompleteState';
export default class OAuthState extends AbstractState {
enter(context) {
const {query, params} = context.getRequest();
2016-03-02 02:06:14 +05:30
return context.run('oAuthValidate', {
clientId: query.client_id || params.clientId,
2016-03-02 02:06:14 +05:30
redirectUrl: query.redirect_uri,
responseType: query.response_type,
description: query.description,
2016-03-02 02:06:14 +05:30
scope: query.scope,
prompt: query.prompt,
loginHint: query.login_hint,
2016-03-02 02:06:14 +05:30
state: query.state
}).then(() => context.setState(new CompleteState()));
}
}