authelia/internal/suites/action_visit.go
Clément Michaud 2e86f270cd Encode URL set to rd parameter. (#559)
* Encode URL set to rd parameter.

URL encoding that parameter solves PR #476.

Some URL parameters set during redirection were magically disappearing
after the redirection due to the authentication process. By using URL encoding,
those parameters should not be stripped anymore.

* Fix integration tests.
2020-01-19 01:57:42 +11:00

28 lines
661 B
Go

package suites
import (
"context"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func (wds *WebDriverSession) doVisit(t *testing.T, url string) {
err := wds.WebDriver.Get(url)
assert.NoError(t, err)
}
func (wds *WebDriverSession) doVisitAndVerifyOneFactorStep(ctx context.Context, t *testing.T, url string) {
wds.doVisit(t, url)
wds.verifyIsFirstFactorPage(ctx, t)
}
func (wds *WebDriverSession) doVisitLoginPage(ctx context.Context, t *testing.T, targetURL string) {
suffix := ""
if targetURL != "" {
suffix = fmt.Sprintf("?rd=%s", targetURL)
}
wds.doVisitAndVerifyOneFactorStep(ctx, t, fmt.Sprintf("%s/%s", LoginBaseURL, suffix))
}