methods/github/react
React client for the GitHub sign-in method, exported at
@convex-dev/auth/methods/github/react.
useSignInWithGithub starts the sign-in. useOauth returns the state that is shared by all the OAuth methods, for example the error of the last flow.
const { signIn } = useSignInWithGithub(api.auth);
const { flowError } = useOauth();
Type Aliases
UseSignInWithGithubReturn
type UseSignInWithGithubReturn = object;
What useSignInWithGithub returns.
Properties
| Property | Type | Description |
|---|---|---|
signIn | UseOauthSignInReturn["signIn"] | Start GitHub's OAuth flow. See UseOauthSignInReturn.signIn. |
Functions
useSignInWithGithub()
function useSignInWithGithub(api): UseSignInWithGithubReturn;
Sign in with GitHub. Pass the module exporting the functions of the method
(usually the generated api.auth), or an object mapping the canonical keys
to renamed exports.
Parameters
| Parameter | Type |
|---|---|
api | { completeSignInWithGithub: FunctionReference<"mutation", "public", { code: string; state: string; }, ClientView< | { status: "complete"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { status: "error"; userError: { error: "INVALID_CODE"; }; }>>; startSignInWithGithub: FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }>; } |
api.completeSignInWithGithub | FunctionReference<"mutation", "public", { code: string; state: string; }, ClientView< | { status: "complete"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { status: "error"; userError: { error: "INVALID_CODE"; }; }>> |
api.startSignInWithGithub | FunctionReference<"mutation", "public", { redirectTo: string; }, { redirect: string; state: string; }> |
Returns
References
OauthCompleteResult
Re-exports OauthCompleteResult
OauthFlowError
Re-exports OauthFlowError
OauthStartResult
Re-exports OauthStartResult
SignInOptions
Re-exports SignInOptions
useOauth
Re-exports useOauth
UseOauthReturn
Re-exports UseOauthReturn