mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
b786b2e1f5
This change aims to factorize code introduced in #1467 for webdriver port customisation within the suites. Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
28 lines
512 B
Go
28 lines
512 B
Go
package suites
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
)
|
|
|
|
// GetLoginBaseURL returns the URL of the login portal and the path prefix if specified.
|
|
func GetLoginBaseURL() string {
|
|
if PathPrefix != "" {
|
|
return LoginBaseURL + PathPrefix
|
|
}
|
|
|
|
return LoginBaseURL
|
|
}
|
|
|
|
// GetWebDriverPort returns the port to initialize the webdriver with.
|
|
func GetWebDriverPort() int {
|
|
driverPort := os.Getenv("CHROMEDRIVER_PORT")
|
|
if driverPort == "" {
|
|
driverPort = defaultChromeDriverPort
|
|
}
|
|
|
|
p, _ := strconv.Atoi(driverPort)
|
|
|
|
return p
|
|
}
|