Skip to content
Prev Previous commit
Next Next commit
Merge branch 'main' into oauth
  • Loading branch information
kylecarbs committed Apr 19, 2022
commit 86f2f4a9486e5f3ee2bcf9d0d32aacf0271a4eb7
5 changes: 3 additions & 2 deletions site/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios, { AxiosRequestHeaders } from "axios"
import { mutate } from "swr"
import { MockPager, MockUser, MockUser2 } from "../testHelpers/entities"
import * as Types from "./types"
import * as TypesGen from "./typesGenerated"

const CONTENT_TYPE_JSON: AxiosRequestHeaders = {
"Content-Type": "application/json",
Expand Down Expand Up @@ -65,8 +66,8 @@ export const getUser = async (): Promise<Types.UserResponse> => {
return response.data
}

export const getAuthMethods = async (): Promise<Types.AuthMethods> => {
const response = await axios.get<Types.AuthMethods>("/api/v2/users/authmethods")
export const getAuthMethods = async (): Promise<TypesGen.AuthMethods> => {
const response = await axios.get<TypesGen.AuthMethods>("/api/v2/users/authmethods")
return response.data
}

Expand Down
5 changes: 0 additions & 5 deletions site/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ export interface UserResponse {
readonly name: string
}

export interface AuthMethods {
readonly password: boolean
readonly github: boolean
}

/**
* `Organization` must be kept in sync with the go struct in organizations.go
*/
Expand Down
6 changes: 6 additions & 0 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ export interface CreateWorkspaceRequest {
readonly name: string
}

// From codersdk/users.go:81:6.
export interface AuthMethods {
readonly password: boolean
readonly github: boolean
}

// From codersdk/workspaceagents.go:31:6.
export interface GoogleInstanceIdentityToken {
readonly json_web_token: string
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.