From 6be823a04f48d2de9144d96b06d6ecab64b3ad0d Mon Sep 17 00:00:00 2001 From: Matthias Rolke Date: Fri, 29 Mar 2019 11:35:27 +0100 Subject: [PATCH] fix: set login retURL to setup page The personal information page (`setup/personalInformationSetup.apexp`) seems to be not available in all orgs. --- src/browserforce.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/browserforce.ts b/src/browserforce.ts index 117ec494..e2d507de 100644 --- a/src/browserforce.ts +++ b/src/browserforce.ts @@ -4,8 +4,7 @@ import * as puppeteer from 'puppeteer'; import * as querystring from 'querystring'; import { parse, URL } from 'url'; -const PERSONAL_INFORMATION_PATH = - 'setup/personalInformationSetup.apexp?nooverride=1'; +const POST_LOGIN_PATH = 'setup/forcecomHomepage.apexp'; const ERROR_DIV_SELECTOR = '#errorTitle'; const ERROR_DIVS_SELECTOR = 'div.errorMsg'; @@ -29,7 +28,7 @@ export default class Browserforce { await this.openPage( `secur/frontdoor.jsp?sid=${ this.org.getConnection().accessToken - }&retURL=${encodeURIComponent(PERSONAL_INFORMATION_PATH)}`, + }&retURL=${encodeURIComponent(POST_LOGIN_PATH)}`, { waitUntil: ['load', 'domcontentloaded', 'networkidle0'] } ); return this;