From fb372627be5efd5bc1e1b2718d2fd6955e120729 Mon Sep 17 00:00:00 2001 From: kkalev Date: Mon, 27 Nov 2023 14:58:13 +0200 Subject: [PATCH] the url argument is not required --- gunet.js | 4 +--- login.js | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gunet.js b/gunet.js index 95eb730..0bc7e4c 100644 --- a/gunet.js +++ b/gunet.js @@ -132,9 +132,7 @@ exports.assertNoTicketGrantingCookie = async (page) => { assert(tgc.length === 0); } -exports.casLogin = async (page, url, user, password, cas_type = "cas") => { - console.log(`Going to ${url}`); - await page.goto(url); +exports.casLogin = async (page, user, password, cas_type = "cas") => { await page.waitForTimeout(1000) await this.loginWith(page, user, password); await this.assertTicketGrantingCookie(page); diff --git a/login.js b/login.js index 42e4731..5688c63 100644 --- a/login.js +++ b/login.js @@ -6,7 +6,8 @@ console.log(url[0]); (async () => { const browser = await puppeteer.launch(gunet.browserOptions()); const page = await gunet.newPage(browser); - await gunet.casLogin(page, url[0], `${process.env.CAS_USER}`, + await page.goto(url); + await gunet.casLogin(page, `${process.env.CAS_USER}`, `${process.env.CAS_PASSWORD}`,`${process.env.CAS_TYPE}`); await browser.close(); })();