update layu

This commit is contained in:
2025-02-21 22:00:32 -03:00
parent e3f39a0313
commit 7b51166db8
15 changed files with 417 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ import {
useCallback,
createContext,
useState,
useEffect,
} from 'react'
import * as Auth from 'aws-amplify/auth'
@@ -22,6 +23,12 @@ export function useAuth() {
export function AuthProvider({ children }) {
const [authUser, setAuthUser] = useState(null)
useEffect(() => {
Auth.fetchUserAttributes().then((user) => {
setAuthUser(user)
})
}, [])
const signIn = useCallback(async ({ username, password }) => {
const signInOut = await Auth.signIn({
username,