Skip to content

Instantly share code, notes, and snippets.

View jranson's full-sized avatar

James Ranson jranson

View GitHub Profile
@jranson
jranson / context.ts
Created March 3, 2023 17:27 — forked from bodokaiser/context.ts
React Hook integration for AWS Amplify Auth
import React from "react"
import { CognitoUser } from "@aws-amplify/auth"
import { useAuth } from "./hooks"
import { SignInInput } from "./types"
interface AuthState {
user: CognitoUser | null
signIn(input : SignInInput): Promise<void>
signOut(): Promise<void>