mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 12:27:43 +00:00
chore: fix examples
This commit is contained in:
@@ -41,3 +41,5 @@ export const {
|
|||||||
useListOrganizations,
|
useListOrganizations,
|
||||||
useActiveOrganization,
|
useActiveOrganization,
|
||||||
} = client;
|
} = client;
|
||||||
|
|
||||||
|
const c = await client.getSession();
|
||||||
|
|||||||
@@ -22,12 +22,6 @@ const libsql = new LibsqlDialect({
|
|||||||
authToken: process.env.TURSO_AUTH_TOKEN || "",
|
authToken: process.env.TURSO_AUTH_TOKEN || "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const s = {
|
|
||||||
extra: {
|
|
||||||
type: "string",
|
|
||||||
},
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
appName: "Better Auth Demo",
|
appName: "Better Auth Demo",
|
||||||
database: {
|
database: {
|
||||||
@@ -35,7 +29,7 @@ export const auth = betterAuth({
|
|||||||
type: "sqlite",
|
type: "sqlite",
|
||||||
},
|
},
|
||||||
emailVerification: {
|
emailVerification: {
|
||||||
async sendVerificationEmail(user, url) {
|
async sendVerificationEmail({ user, url }) {
|
||||||
console.log("Sending verification email to", user.email);
|
console.log("Sending verification email to", user.email);
|
||||||
const res = await resend.emails.send({
|
const res = await resend.emails.send({
|
||||||
from,
|
from,
|
||||||
@@ -54,7 +48,7 @@ export const auth = betterAuth({
|
|||||||
},
|
},
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
async sendResetPassword(user, url) {
|
async sendResetPassword({ user, url }) {
|
||||||
await resend.emails.send({
|
await resend.emails.send({
|
||||||
from,
|
from,
|
||||||
to: user.email,
|
to: user.email,
|
||||||
@@ -119,7 +113,7 @@ export const auth = betterAuth({
|
|||||||
}),
|
}),
|
||||||
twoFactor({
|
twoFactor({
|
||||||
otpOptions: {
|
otpOptions: {
|
||||||
async sendOTP(user, otp) {
|
async sendOTP({ user, otp }) {
|
||||||
await resend.emails.send({
|
await resend.emails.send({
|
||||||
from,
|
from,
|
||||||
to: user.email,
|
to: user.email,
|
||||||
|
|||||||
Reference in New Issue
Block a user