added redirect verb

This commit is contained in:
Dave Horton
2020-01-27 08:35:31 -05:00
parent 6f51ebacee
commit bed4fa1f42
6 changed files with 55 additions and 7 deletions

23
lib/tasks/redirect.js Normal file
View File

@@ -0,0 +1,23 @@
const Task = require('./task');
const {TaskName} = require('../utils/constants');
/**
* Redirects to a new application
*/
class TaskRedirect extends Task {
constructor(logger, opts) {
super(logger, opts);
this.action = this.data.action;
this.method = this.data.method || 'POST';
}
get name() { return TaskName.Redirect; }
async exec(cs) {
super.exec(cs);
await this.performAction(this.method, this.auth);
}
}
module.exports = TaskRedirect;