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', {
|
2017-05-26 00:41:57 +05:30
|
|
|
clientId: query.get('client_id') || params.clientId,
|
|
|
|
redirectUrl: query.get('redirect_uri'),
|
|
|
|
responseType: query.get('response_type'),
|
|
|
|
description: query.get('description'),
|
|
|
|
scope: query.get('scope'),
|
|
|
|
prompt: query.get('prompt'),
|
|
|
|
loginHint: query.get('login_hint'),
|
|
|
|
state: query.get('state')
|
2016-03-02 02:06:14 +05:30
|
|
|
}).then(() => context.setState(new CompleteState()));
|
|
|
|
}
|
|
|
|
}
|