open-vault/ui/app/routes/application.js
Matthew Irish 9953eb76aa
UI - control groups (#4947)
* add routes for control groups in tools, settings, access (#4718)
* UI control group - storage, request, authorization, and unwrapping (#4899)
* UI control groups config (#4927)
2018-07-18 20:59:04 -05:00

24 lines
592 B
JavaScript

import Ember from 'ember';
import ControlGroupError from 'vault/lib/control-group-error';
const { inject } = Ember;
export default Ember.Route.extend({
controlGroup: inject.service(),
actions: {
willTransition() {
window.scrollTo(0, 0);
},
error(err, transition) {
let controlGroup = this.get('controlGroup');
if (err instanceof ControlGroupError) {
return controlGroup.handleError(err, transition);
}
if (err.path === '/v1/sys/wrapping/unwrap') {
controlGroup.unmarkTokenForUnwrap();
}
return true;
},
},
});