Skip to content

Commit db07849

Browse files
committed
Fix authmethods in test
1 parent 4f1e907 commit db07849

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

coderd/userauth.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ func (api *api) userOAuth2Github(rw http.ResponseWriter, r *http.Request) {
109109
}
110110

111111
var organizationID uuid.UUID
112-
organizations, err := api.Database.GetOrganizations(r.Context())
113-
if err == nil {
112+
organizations, _ := api.Database.GetOrganizations(r.Context())
113+
if len(organizations) > 0 {
114114
// Add the user to the first organization. Once multi-organization
115115
// support is added, we should enable a configuration map of user
116116
// email to organization.

site/src/pages/login.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("SignInPage", () => {
1818
)
1919
// only leave password auth enabled by default
2020
server.use(
21-
rest.get("/api/v2/users/auth", (req, res, ctx) => {
21+
rest.get("/api/v2/users/authmethods", (req, res, ctx) => {
2222
return res(
2323
ctx.status(200),
2424
ctx.json({
@@ -66,7 +66,7 @@ describe("SignInPage", () => {
6666
it("shows github authentication when enabled", async () => {
6767
// Given
6868
server.use(
69-
rest.get("/api/v2/users/auth", async (req, res, ctx) => {
69+
rest.get("/api/v2/users/authmethods", async (req, res, ctx) => {
7070
return res(
7171
ctx.status(200),
7272
ctx.json({

0 commit comments

Comments
 (0)