Mattèo
Mattèo
Explore posts from servers
BABetter Auth
Created by Mattèo on 4/27/2025 in #help
How to handle phoneNumber.sendOtp errors ? Only 500 is returned
Noticed this also happens in the MagicLink plugin, error thrown in the sendMagicLink method are not returning 500 error..
5 replies
BABetter Auth
Created by Mattèo on 4/27/2025 in #help
How to handle phoneNumber.sendOtp errors ? Only 500 is returned
hey thanks for your reply, that might fit for a temporary solution..
5 replies
HHono
Created by Mattèo on 4/22/2025 in #help
Got `unknown` type on res.json() on a OpenAPI RPC route
Ah, I see. Thanks a lot; that makes sense !! Thanks for your time
3 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
With Prisma generated client
user: {
additionalFields: {
role: {
type: Object.values(Role),
default: ["USER"],
required: true,
},
},
},
user: {
additionalFields: {
role: {
type: Object.values(Role),
default: ["USER"],
required: true,
},
},
},
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
Thanks a lot for your help @bekacru @Phantom ! ✅✅✅
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
oh yes I see
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
No description
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
thanks, this implementation kind of work, but the Prisma adapter creates a String[] instead of a reference to an enum.
19 replies
HHono
Created by Mattèo on 1/31/2025 in #help
Using @hono/auth-js with one API server (auth) and one web server (front) ?
Hope to see a guide on server implementations 🙏 (covering XSS, CORS, sharing types, etc...)
17 replies
HHono
Created by Mattèo on 1/31/2025 in #help
Using @hono/auth-js with one API server (auth) and one web server (front) ?
Thanks for your explanation, I completely understand the design choice of targeting full stack framework app, some devs like me have different needs in the age of "server first" / "RSC" / "meta-framework" 😅
17 replies
HHono
Created by Mattèo on 1/31/2025 in #help
Using @hono/auth-js with one API server (auth) and one web server (front) ?
Yes we can say that, Imagine I want to build a mobile app in the future, I might want to rely on an auth server since the native environment is completely different
17 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
No problem, but the TS error is still appearing
user: {
role: {
// ^? error here
type: ["ADMIN", "USER"]
}
}
user: {
role: {
// ^? error here
type: ["ADMIN", "USER"]
}
}
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
None of these implementations works for me, I got TS errors (even this snippet ⬆️)
// Server Side
export const auth = betterAuth({
user: {
fields: {
role: ["ADMIN", "USER"],
// ^? error here
},
},
user: {
role: ["ADMIN", "USER"],
// ^? error here
},
user: {
additionalFields: {
role: ["ADMIN", "USER"],
// ^? error here
},
},
})
// Server Side
export const auth = betterAuth({
user: {
fields: {
role: ["ADMIN", "USER"],
// ^? error here
},
},
user: {
role: ["ADMIN", "USER"],
// ^? error here
},
user: {
additionalFields: {
role: ["ADMIN", "USER"],
// ^? error here
},
},
})
19 replies
BABetter Auth
Created by Mattèo on 2/4/2025 in #help
Is it a possible to use enum as type for fields in additionalFields ?
Yes exactly, i'm using Prisma as database adapter and I have a role: Role? field
19 replies
BABetter Auth
Created by Mattèo on 1/30/2025 in #help
Hono + Bun gives a 404 on /api/auth/ok endpoint
Very strange ...
7 replies
BABetter Auth
Created by Mattèo on 1/30/2025 in #help
Hono + Bun gives a 404 on /api/auth/ok endpoint
Yes, I solved the issue by reordering them, checkout the code changes in this PR to fix the issue https://github.com/better-auth/better-auth/pull/1317
7 replies
BABetter Auth
Created by Mattèo on 1/30/2025 in #help
Hono + Bun gives a 404 on /api/auth/ok endpoint
Problem solved the /api/auth/** handler is not well written, change it to /api/auth/* (PR that solve the issue in better-auth docs https://github.com/better-auth/better-auth/pull/1317)
7 replies
HHono
Created by Mattèo on 1/30/2025 in #help
Hono + Bun + Better Auth 404 error when using app.route
Problem solved the /api/auth/** handler is not well written, change it to /api/auth/* (PR that solve the issue in better-auth docs https://github.com/better-auth/better-auth/pull/1317)
2 replies