Imam
Imam
Explore posts from servers
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
can you just hard code the url? i mean do not use env variables just for testing
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
better-auth docs
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
u could check the docs about it
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
how about the trustedOrigins?
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
next.js + hono (seperate repo)
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
but you should concern about the url stuff, the cors would not giving any errors
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
i was using hono and just works
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
i think using next.js with express would work perfectly fine
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
are you still facing this issue on the latest version of elysia + node adpater & better-auth? since facing this issue, i don't use elysia again
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
i'll try to double check it again, thanks for the suggestion @Laktos
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
even i hardcoded it, the cors keep yelling, i don't know why
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
No description
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
client auth.ts
import { usernameClient } from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/react';

export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL, // the base url of your auth server
emailAndPassword: {
enabled: true,
},
plugins: [usernameClient()],
fetchOptions: {
credentials: 'include',
},
});
import { usernameClient } from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/react';

export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL, // the base url of your auth server
emailAndPassword: {
enabled: true,
},
plugins: [usernameClient()],
fetchOptions: {
credentials: 'include',
},
});
22 replies
BABetter Auth
Created by Imam on 12/26/2024 in #help
Cors Error on Elysia with Node Adapter
server auth.ts
import { db } from '@repo/db'; // your drizzle instance
import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { username } from 'better-auth/plugins';

export const auth = betterAuth({
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL,
database: drizzleAdapter(db, {
provider: 'pg',
}),
emailAndPassword: {
enabled: true,
},
plugins: [username()],
trustedOrigins: [process.env.NEXT_PUBLIC_WEB_BASE_URL!],
});
import { db } from '@repo/db'; // your drizzle instance
import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { username } from 'better-auth/plugins';

export const auth = betterAuth({
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL,
database: drizzleAdapter(db, {
provider: 'pg',
}),
emailAndPassword: {
enabled: true,
},
plugins: [username()],
trustedOrigins: [process.env.NEXT_PUBLIC_WEB_BASE_URL!],
});
22 replies
BABetter Auth
Created by Imam on 12/23/2024 in #help
Can't Build in Turborepo with tsup
it solved, you can mark it as Solved, thank you for helping me 🙂
24 replies
BABetter Auth
Created by Imam on 12/23/2024 in #help
Can't Build in Turborepo with tsup
No description
24 replies
BABetter Auth
Created by Imam on 12/23/2024 in #help
Can't Build in Turborepo with tsup
you can check my repo
24 replies
BABetter Auth
Created by Imam on 12/23/2024 in #help
Can't Build in Turborepo with tsup
that errors is from version 1.1.3 tho
24 replies