Skip to content

Commit

Permalink
fix: fixed handlers for kratos api proxying
Browse files Browse the repository at this point in the history
  • Loading branch information
bencekov committed Aug 22, 2023
1 parent 4266a50 commit 2ac0764
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/kratos/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (a *API) handleCreateFlow(w http.ResponseWriter, r *http.Request) {
refresh = false
}

returnTo, err := url.JoinPath(a.baseURL, "/login")
returnTo, err := url.JoinPath(a.baseURL, "/ui/login")
if err != nil {
a.logger.Fatal("Failed to construct returnTo URL: ", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kratos/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestHandleCreateFlowWithoutSession(t *testing.T) {
flow.Id = "test"

loginChallenge := "login_challenge_2341235123231"
returnTo, _ := url.JoinPath(BASE_URL, "login")
returnTo, _ := url.JoinPath(BASE_URL, "ui/login")
returnTo = returnTo + "?login_challenge=" + loginChallenge

req := httptest.NewRequest(http.MethodGet, HANDLE_CREATE_FLOW_URL, nil)
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestHandleCreateFlowWithoutSessionFailOnCreateBrowserLoginFlow(t *testing.T
flow.Id = "test"

loginChallenge := "login_challenge_2341235123231"
returnTo, _ := url.JoinPath(BASE_URL, "login")
returnTo, _ := url.JoinPath(BASE_URL, "ui/login")
returnTo = returnTo + "?login_challenge=" + loginChallenge

req := httptest.NewRequest(http.MethodGet, HANDLE_CREATE_FLOW_URL, nil)
Expand Down

0 comments on commit 2ac0764

Please sign in to comment.