Skip to content

Commit c4931b6

Browse files
committed
Fix git auth redirect
1 parent c4a3dba commit c4931b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coderd/externalauth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func TestGitAuthCallback(t *testing.T) {
268268
agentClient.SetSessionToken(authToken)
269269
token, err := agentClient.GitAuth(context.Background(), "github.com/asd/asd", false)
270270
require.NoError(t, err)
271-
require.True(t, strings.HasSuffix(token.URL, fmt.Sprintf("/external-auth/%s", "github")))
271+
require.True(t, strings.HasSuffix(token.URL, fmt.Sprintf("/external-auth/%s", "github")), token.URL)
272272
})
273273
t.Run("UnauthorizedCallback", func(t *testing.T) {
274274
t.Parallel()

coderd/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ func (api *API) workspaceAgentsGitAuth(rw http.ResponseWriter, r *http.Request)
22782278
}
22792279

22802280
// This is the URL that will redirect the user with a state token.
2281-
redirectURL, err := api.AccessURL.Parse(fmt.Sprintf("/externalauth/%s", externalAuthConfig.ID))
2281+
redirectURL, err := api.AccessURL.Parse(fmt.Sprintf("/external-auth/%s", externalAuthConfig.ID))
22822282
if err != nil {
22832283
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
22842284
Message: "Failed to parse access URL.",

0 commit comments

Comments
 (0)