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