bugyo-cloud-client
Version:
HTTP client for Bugyo Cloud
37 lines • 1.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoginTask = void 0;
/**
* ログイン実行します。
*/
class LoginTask {
logger;
loginPage;
checkAuthenticationMethod;
authenticate;
omRedirect;
authInfo;
constructor(logger, loginPage, checkAuthenticationMethod, authenticate, omRedirect, authInfo) {
this.logger = logger;
this.loginPage = loginPage;
this.checkAuthenticationMethod = checkAuthenticationMethod;
this.authenticate = authenticate;
this.omRedirect = omRedirect;
this.authInfo = authInfo;
}
async execute(client) {
this.logger.trace("Invoking Loginpage.");
const token = await this.loginPage.invoke(client);
this.logger.debug("Got token: %s", token);
this.logger.trace("Invoking CheckAuthenticationMethod.");
await this.checkAuthenticationMethod.invoke(client, token, this.authInfo);
this.logger.trace("Invoking Authenticate.");
const redirectUrl = await this.authenticate.invoke(client, token, this.authInfo);
this.logger.trace("Invoking OmRedirect.");
const userCode = await this.omRedirect.invoke(client, redirectUrl);
this.logger.debug("Got userCode: %s", userCode);
client.userCode = userCode;
}
}
exports.LoginTask = LoginTask;
//# sourceMappingURL=login-task.js.map