mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-30 00:40:41 +05:30
29 lines
641 B
TypeScript
29 lines
641 B
TypeScript
import AbstractState from './AbstractState';
|
|
import CompleteState from './CompleteState';
|
|
|
|
export default class PermissionsState extends AbstractState {
|
|
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'),
|
|
});
|
|
}
|
|
|
|
resolve(context) {
|
|
this.process(context, true);
|
|
}
|
|
|
|
reject(context) {
|
|
this.process(context, false);
|
|
}
|
|
|
|
process(context, accept) {
|
|
context.setState(
|
|
new CompleteState({
|
|
accept,
|
|
}),
|
|
);
|
|
}
|
|
}
|