Skip to content

feat: Add GitHub OAuth #1050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 23, 2022
Merged
Prev Previous commit
Next Next commit
Merge branch 'main' into oauth
  • Loading branch information
kylecarbs committed Apr 20, 2022
commit 9c3d81e67d62005b374b8990e8fc591cfc0393d0
1 change: 1 addition & 0 deletions cli/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func start() *cobra.Command {
traceDatadog bool
secureAuthCookie bool
sshKeygenAlgorithmRaw string
spooky bool
)

root := &cobra.Command{
Expand Down
8 changes: 4 additions & 4 deletions site/src/components/SignInForm/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import TextField from "@material-ui/core/TextField"
import { FormikContextType, useFormik } from "formik"
import React from "react"
import * as Yup from "yup"
import { AuthMethods } from "../../api/types"
import { LoadingButton } from "../Button"
import { getFormHelpers, onChangeTrimmed } from "../Form"
import { Welcome } from "./Welcome"
import { AuthMethods } from "../../api/typesGenerated"
import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
import { Welcome } from "../Welcome/Welcome"
import { LoadingButton } from "./../LoadingButton/LoadingButton"

/**
* BuiltInAuthFormValues describes a form using built-in (email/password)
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/LoginPage/LoginPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("LoginPage", () => {
)

// When
render(<SignInPage />)
render(<LoginPage />)

// Then
const errorMessage = await screen.findByText(Language.methodsErrorMessage)
Expand All @@ -83,7 +83,7 @@ describe("LoginPage", () => {
)

// When
render(<SignInPage />)
render(<LoginPage />)

// Then
await screen.findByText(Language.passwordSignIn)
Expand Down
2 changes: 1 addition & 1 deletion site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
AuthMethods,
BuildInfoResponse,
Organization,
Pager,
Expand All @@ -10,6 +9,7 @@ import {
Workspace,
WorkspaceAutostartRequest,
} from "../api/types"
import { AuthMethods } from "../api/typesGenerated"

export const MockSessionToken = { session_token: "my-session-token" }

Expand Down
5 changes: 3 additions & 2 deletions site/src/xServices/auth/authXService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { assign, createMachine } from "xstate"
import * as API from "../../api"
import * as Types from "../../api/types"
import * as TypesGen from "../../api/typesGenerated"
import { displaySuccess } from "../../components/GlobalSnackbar/utils"

export const Language = {
Expand All @@ -13,7 +14,7 @@ export interface AuthContext {
authError?: Error | unknown
updateProfileError?: Error | unknown
me?: Types.UserResponse
methods?: Types.AuthMethods
methods?: TypesGen.AuthMethods
}

export type AuthEvent =
Expand Down Expand Up @@ -42,7 +43,7 @@ export const authMachine =
data: Types.UserResponse
}
getMethods: {
data: Types.AuthMethods
data: TypesGen.AuthMethods
}
signIn: {
data: Types.LoginResponse
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.