Rename baseDomain() to rootDomain(). Use the right terminology. Change-Id: I2626c64fcc00d4276acbb1a493d3050c15dfccf0 Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/686216 Commit-Queue: Ravi Mistry <rmistry@google.com> Auto-Submit: Joe Gregorio <jcgregorio@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/infra-sk/modules/alogin-sk/alogin-sk.ts b/infra-sk/modules/alogin-sk/alogin-sk.ts index 91239e6..d71a07e 100644 --- a/infra-sk/modules/alogin-sk/alogin-sk.ts +++ b/infra-sk/modules/alogin-sk/alogin-sk.ts
@@ -14,7 +14,7 @@ import { errorMessage } from '../../../elements-sk/modules/errorMessage'; import { ElementSk } from '../ElementSk'; import { Status } from '../json'; -import { baseDomain } from '../login'; +import { rootDomain } from '../login'; const defaultStatusURL = '/_/login/status'; @@ -71,7 +71,7 @@ async connectedCallback(): Promise<void> { super.connectedCallback(); - const domain = baseDomain(); + const domain = rootDomain(); this.login = `https://${domain}/login/`; this.logout = `https://${domain}/logout/`;
diff --git a/infra-sk/modules/login-sk/login-sk.ts b/infra-sk/modules/login-sk/login-sk.ts index 776ee96..7fb1e2a 100644 --- a/infra-sk/modules/login-sk/login-sk.ts +++ b/infra-sk/modules/login-sk/login-sk.ts
@@ -17,7 +17,7 @@ */ import { define } from '../../../elements-sk/modules/define'; import { errorMessage } from '../../../elements-sk/modules/errorMessage'; -import { baseDomain, LoginTo } from '../login'; +import { rootDomain, LoginTo } from '../login'; define( 'login-sk', @@ -26,16 +26,16 @@ this.innerHTML = '<span class=email>Loading...</span><a class=logInOut></a>'; - const host = baseDomain(); + const root = rootDomain(); - const login = `https://${host}/login/`; - const logout = `https://${host}/logout/`; + const login = `https://${root}/login/`; + const logout = `https://${root}/logout/`; if (this.testingOffline) { this.querySelector<HTMLSpanElement>('.email')!.textContent = 'test@example.com'; const logInOut = this.querySelector<HTMLAnchorElement>('.logInOut')!; - logInOut.href = `https://${host}/logout/?redirect=${encodeURIComponent( + logInOut.href = `https://${root}/logout/?redirect=${encodeURIComponent( document.location.toString() )}`; logInOut.textContent = 'Logout';
diff --git a/infra-sk/modules/login.ts b/infra-sk/modules/login.ts index 826aea8..da604f1 100644 --- a/infra-sk/modules/login.ts +++ b/infra-sk/modules/login.ts
@@ -55,13 +55,13 @@ } /** - * Function that returns the base domain of a sub-domain. + * Function that returns the root domain of a sub-domain. * * I.e. it will return "skia.org" if the current location is "perf.skia.org". * * In addition it will fallback to "skia.org" is case we are on corp.goog. */ -export function baseDomain(): string { +export function rootDomain(): string { let ret = window.location.host.split('.').slice(-2).join('.'); if (ret === 'corp.goog') { ret = 'skia.org';