chore: fix examples

This commit is contained in:
Bereket Engida
2024-11-13 20:02:56 +03:00
parent 74f08b7d26
commit f65522487e
2 changed files with 5 additions and 9 deletions

View File

@@ -41,3 +41,5 @@ export const {
useListOrganizations, useListOrganizations,
useActiveOrganization, useActiveOrganization,
} = client; } = client;
const c = await client.getSession();

View File

@@ -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,