File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const session = await auth.api.getSession({
3232 document.querySelector("#login")?.addEventListener("click", async () => {
3333 await signIn.social({
3434 provider: "github",
35+ callbackURL: "/",
3536 });
3637 });
3738 document.querySelector("#logout")?.addEventListener("click", async () => {
Original file line number Diff line number Diff line change 11import { betterAuth } from 'better-auth' ;
2- import { admin } from 'better-auth/plugins' ;
2+ import { admin , oAuthProxy } from 'better-auth/plugins' ;
33import { D1Dialect } from 'kysely-d1' ;
44
55export 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://astro-tips.dev/api/auth/callback/github` ,
2128 } ,
2229 } ,
2330 } ) ;
You can’t perform that action at this time.
0 commit comments