1.0.2 • Published 1 year ago

authli v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Easiest way to login with Next js

Register a user

const user = { email: "john@gmail.com", password: "password" }; // Your user must have an email and password field
await registerUser(user, prisma); // Generate your prisma client and pass it as props

Login a user

const user = { email: "john@gmail.com", password: "password" }; // Your user must have an email and password field
await loginUser(user, prisma); // Generate your prisma client and pass it as props

Using forms with server actions

<form action={async (data: FormData) => { try {
  await authForm(data)
} catch (error) {
  // Handle the error
}  }}>
  <input name="email" />
  <input name="password" />
  <input name="confirm-password" /> <!-- If on the create user page -->
</form>
1.0.2

1 year ago

1.0.0

1 year ago