mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 01:16:55 -05:00
"sign in" and "sign up" as verbs
This commit is contained in:
@@ -134,7 +134,7 @@ export const auth = betterAuth({
|
||||
})
|
||||
```
|
||||
|
||||
### Signin with social providers
|
||||
### Sign in with social providers
|
||||
|
||||
To sign in using a social provider you need to call `signIn.social`. It takes an object with the following properties:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Email OTP
|
||||
description: Email OTP plugin for Better Auth.
|
||||
---
|
||||
|
||||
The Email OTP plugin allows user to sign-in, verify their email, or reset their password using a one-time password (OTP) sent to their email address.
|
||||
The Email OTP plugin allows user to sign in, verify their email, or reset their password using a one-time password (OTP) sent to their email address.
|
||||
|
||||
|
||||
## Installation
|
||||
@@ -59,7 +59,7 @@ const { data, error } = await authClient.emailOtp.sendVerificationOtp({
|
||||
})
|
||||
```
|
||||
|
||||
### SignIn with OTP
|
||||
### Sign in with OTP
|
||||
|
||||
Once the user provides the OTP, you can sign in the user using the `signIn.emailOTP()` method.
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ const { data, error } = await authClient.passkey.addPasskey({
|
||||
});
|
||||
```
|
||||
|
||||
### Signin with a passkey
|
||||
### Sign in with a passkey
|
||||
|
||||
To signin with a passkey you can use the passkeySignIn method. This will prompt the user to sign in with their passkey.
|
||||
To sign in with a passkey you can use the passkeySignIn method. This will prompt the user to sign in with their passkey.
|
||||
|
||||
Signin method accepts:
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ export const auth = betterAuth({
|
||||
})
|
||||
```
|
||||
|
||||
### SignIn with Phone number
|
||||
### Sign In with Phone Number
|
||||
|
||||
In addition to signing in a user using send-verify flow, you can also use phone number as an identifier and sign in a user using phone number and password.
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ The username plugin wraps the email and password authenticator and adds username
|
||||
|
||||
## Usage
|
||||
|
||||
### Signup with username
|
||||
### Sign up with username
|
||||
|
||||
To sign up a user with username, you can use the existing `signUp.email` function provided by the client. The `signUp` function should take a new `username` property in the object.
|
||||
|
||||
@@ -72,9 +72,9 @@ const data = await authClient.signUp.email({
|
||||
})
|
||||
```
|
||||
|
||||
### Signin with username
|
||||
### Sign in with username
|
||||
|
||||
To signin a user with username, you can use the `signIn.username` function provided by the client. The `signIn` function takes an object with the following properties:
|
||||
To sign in a user with username, you can use the `signIn.username` function provided by the client. The `signIn` function takes an object with the following properties:
|
||||
|
||||
- `username`: The username of the user.
|
||||
- `password`: The password of the user.
|
||||
|
||||
@@ -101,7 +101,7 @@ describe("magic link", async () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("should signup with magic link", async () => {
|
||||
it("should sign up with magic link", async () => {
|
||||
const email = "new-email@email.com";
|
||||
await client.signIn.magicLink({
|
||||
email,
|
||||
|
||||
@@ -140,7 +140,7 @@ describe("SSO", async () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("should signin with SSO provider with email matching", async () => {
|
||||
it("should sign in with SSO provider with email matching", async () => {
|
||||
const res = await auth.api.signInSSO({
|
||||
body: {
|
||||
email: "my-email@localhost.com",
|
||||
@@ -156,7 +156,7 @@ describe("SSO", async () => {
|
||||
expect(callbackURL).toContain("/dashboard");
|
||||
});
|
||||
|
||||
it("should signin with SSO provider with domain", async () => {
|
||||
it("should sign in with SSO provider with domain", async () => {
|
||||
const res = await auth.api.signInSSO({
|
||||
body: {
|
||||
email: "my-email@test.com",
|
||||
@@ -173,7 +173,7 @@ describe("SSO", async () => {
|
||||
expect(callbackURL).toContain("/dashboard");
|
||||
});
|
||||
|
||||
it("should signin with SSO provider with providerId", async () => {
|
||||
it("should sign in with SSO provider with providerId", async () => {
|
||||
const res = await auth.api.signInSSO({
|
||||
body: {
|
||||
providerId: "test",
|
||||
@@ -463,7 +463,7 @@ describe("provisioning", async (ctx) => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should signin with SSO provide with org slug", async () => {
|
||||
it("should sign in with SSO provide with org slug", async () => {
|
||||
const res = await auth.api.signInSSO({
|
||||
body: {
|
||||
organizationSlug: "localhost",
|
||||
|
||||
@@ -19,7 +19,7 @@ describe("username", async (it) => {
|
||||
},
|
||||
);
|
||||
|
||||
it("should signup with username", async () => {
|
||||
it("should sign up with username", async () => {
|
||||
const headers = new Headers();
|
||||
await client.signUp.email(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user