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