Skip to content

Commit f25826c

Browse files
add oAuthProxy
1 parent 5fd22ea commit f25826c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lib/auth.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { betterAuth } from 'better-auth';
2-
import { admin } from 'better-auth/plugins';
2+
import { admin, oAuthProxy } from 'better-auth/plugins';
33
import { D1Dialect } from 'kysely-d1';
44

55
export const auth = (url: string, env: Env) => {
@@ -13,11 +13,18 @@ export const auth = (url: string, env: Env) => {
1313
rateLimit: {
1414
enabled: true,
1515
},
16-
plugins: [admin()],
16+
plugins: [
17+
oAuthProxy({
18+
productionURL: 'https://astro-tips.dev',
19+
currentURL: url,
20+
}),
21+
admin(),
22+
],
1723
socialProviders: {
1824
github: {
1925
clientId: env.GITHUB_CLIENT_ID,
2026
clientSecret: env.GITHUB_CLIENT_SECRET,
27+
redirectURI: `https://my-main-app.com/api/auth/callback/github`,
2128
},
2229
},
2330
});

0 commit comments

Comments
 (0)