Jïns
Jïns
Explore posts from servers
BABetter Auth
Created by Jïns on 4/26/2025 in #help
Unable to check permisions
?
9 replies
BABetter Auth
Created by Jïns on 4/26/2025 in #help
Unable to check permisions
Someone has an idea ?
9 replies
BABetter Auth
Created by Jïns on 4/26/2025 in #help
Unable to check permisions
there is my auth-client.ts
import { createAuthClient } from "better-auth/react";
import { adminClient } from "better-auth/client/plugins";
import { ac, admin as adminRole } from "@/lib/permissions";
import { nextCookies } from "better-auth/next-js";
export const authClient = createAuthClient({
baseURL: "http://localhost:3000",
plugins: [
adminClient({
ac,
roles: {
admin: adminRole,
},
}),
nextCookies(),
],
});
import { createAuthClient } from "better-auth/react";
import { adminClient } from "better-auth/client/plugins";
import { ac, admin as adminRole } from "@/lib/permissions";
import { nextCookies } from "better-auth/next-js";
export const authClient = createAuthClient({
baseURL: "http://localhost:3000",
plugins: [
adminClient({
ac,
roles: {
admin: adminRole,
},
}),
nextCookies(),
],
});
9 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
thx a lot
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
I found thats quick fix export type User = typeof auth.$Infer.Session["user"];
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
Yeah but Thats the session
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
How you import the type in the front ?
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
Yeah Last question
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
the boss
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
thx a lot for your help
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
import { createAuthClient } from "better-auth/client";

export const authClient = createAuthClient({
// URL de base de votre API auth
baseURL: "http://localhost:3000",
});
import { createAuthClient } from "better-auth/client";

export const authClient = createAuthClient({
// URL de base de votre API auth
baseURL: "http://localhost:3000",
});
I have only this in my authClient
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
But lets see what mclovin have to say 🙂
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
Found a quick fix
export type User = typeof auth.$Infer.Session["user"];
export type User = typeof auth.$Infer.Session["user"];
adding this in the auth.ts
19 replies
BABetter Auth
Created by Jïns on 4/25/2025 in #help
Extend type user
Thx for any help
19 replies
BABetter Auth
Created by Jïns on 4/20/2025 in #help
Issue with Better-Auth Email Verification
import { sendEmail } from "@/lib/SendEmail";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { adminClient } from "better-auth/client/plugins";
import { nextCookies } from "better-auth/next-js";
import { admin } from "better-auth/plugins";
import { db } from "../../db/connection";

export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),

emailAndPassword: {
enabled: true,
sendResetPassword: async ({ user, url }) => {
await sendEmail({
from: process.env.EMAIL_NODEMAILER || "",
to: user.email,
subject: "Password Reset",
text: `Click the link to reset your password: ${url}`,
});
},
},
user: {
changeEmail: {
enabled: true,
sendChangeEmailVerification: async ({ newEmail, url }) => {
// Il faudrait ajouter ceci:
await sendEmail({
from: process.env.EMAIL_NODEMAILER || "",
to: newEmail, // Envoyer à la nouvelle adresse email
subject: "Vérification d'email",
text: `Cliquez sur ce lien pour vérifier votre nouvelle adresse email: ${url}`,
});
},
},
additionalFields: {
truc_de_con: {
type: "string",
nullable: true,
},
},
},
plugins: [nextCookies(), admin(), adminClient()],
});

export type Session = typeof auth.$Infer.Session;
import { sendEmail } from "@/lib/SendEmail";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { adminClient } from "better-auth/client/plugins";
import { nextCookies } from "better-auth/next-js";
import { admin } from "better-auth/plugins";
import { db } from "../../db/connection";

export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),

emailAndPassword: {
enabled: true,
sendResetPassword: async ({ user, url }) => {
await sendEmail({
from: process.env.EMAIL_NODEMAILER || "",
to: user.email,
subject: "Password Reset",
text: `Click the link to reset your password: ${url}`,
});
},
},
user: {
changeEmail: {
enabled: true,
sendChangeEmailVerification: async ({ newEmail, url }) => {
// Il faudrait ajouter ceci:
await sendEmail({
from: process.env.EMAIL_NODEMAILER || "",
to: newEmail, // Envoyer à la nouvelle adresse email
subject: "Vérification d'email",
text: `Cliquez sur ce lien pour vérifier votre nouvelle adresse email: ${url}`,
});
},
},
additionalFields: {
truc_de_con: {
type: "string",
nullable: true,
},
},
},
plugins: [nextCookies(), admin(), adminClient()],
});

export type Session = typeof auth.$Infer.Session;
sorry for the response time
9 replies
BABetter Auth
Created by Jïns on 4/20/2025 in #help
Issue with Better-Auth Email Verification
Yeah but I did this
console.log("sendChangeEmailVerification", user, newEmail, url, token);
console.log("sendChangeEmailVerification", user, newEmail, url, token);
to see if the function get triggered but nothing
9 replies
DIAdiscord.js - Imagine an app
Created by Mat on 8/23/2023 in #djs-questions
Detect replies and edit own message
there is nothing like that in discord js so u have to create ur own
8 replies
DIAdiscord.js - Imagine an app
Created by Mat on 8/23/2023 in #djs-questions
Detect replies and edit own message
i think u have to do ur own logical
8 replies