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({
32
32
document.querySelector("#login")?.addEventListener("click", async () => {
33
33
await signIn.social({
34
34
provider: "github",
35
+ callbackURL: "/",
35
36
});
36
37
});
37
38
document.querySelector("#logout")?.addEventListener("click", async () => {
Original file line number Diff line number Diff line change 1
1
import { betterAuth } from 'better-auth' ;
2
- import { admin } from 'better-auth/plugins' ;
2
+ import { admin , oAuthProxy } from 'better-auth/plugins' ;
3
3
import { D1Dialect } from 'kysely-d1' ;
4
4
5
5
export const auth = ( url : string , env : Env ) => {
@@ -13,11 +13,18 @@ export const auth = (url: string, env: Env) => {
13
13
rateLimit : {
14
14
enabled : true ,
15
15
} ,
16
- plugins : [ admin ( ) ] ,
16
+ plugins : [
17
+ oAuthProxy ( {
18
+ productionURL : 'https://astro-tips.dev' ,
19
+ currentURL : url ,
20
+ } ) ,
21
+ admin ( ) ,
22
+ ] ,
17
23
socialProviders : {
18
24
github : {
19
25
clientId : env . GITHUB_CLIENT_ID ,
20
26
clientSecret : env . GITHUB_CLIENT_SECRET ,
27
+ redirectURI : `https://astro-tips.dev/api/auth/callback/github` ,
21
28
} ,
22
29
} ,
23
30
} ) ;
You can’t perform that action at this time.
0 commit comments