2016-03-02 02:06:14 +05:30
|
|
|
import AbstractState from './AbstractState';
|
2016-03-15 12:06:13 +05:30
|
|
|
import CompleteState from './CompleteState';
|
2016-03-02 02:06:14 +05:30
|
|
|
|
|
|
|
export default class PermissionsState extends AbstractState {
|
2019-11-27 14:33:32 +05:30
|
|
|
enter(context) {
|
|
|
|
context.navigate('/oauth/permissions', {
|
|
|
|
// replacing oauth entry point if currently on it
|
|
|
|
// to allow user easy go-back action to client's site
|
|
|
|
replace: context.getRequest().path.includes('oauth2'),
|
|
|
|
});
|
|
|
|
}
|
2016-03-02 02:06:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
resolve(context) {
|
|
|
|
this.process(context, true);
|
|
|
|
}
|
2016-03-02 02:06:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
reject(context) {
|
|
|
|
this.process(context, false);
|
|
|
|
}
|
2016-03-02 02:06:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
process(context, accept) {
|
|
|
|
context.setState(
|
|
|
|
new CompleteState({
|
|
|
|
accept,
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
2016-03-02 02:06:14 +05:30
|
|
|
}
|