@@ -5,7 +5,6 @@ import { eq } from "drizzle-orm";
5
5
import { github , lucia } from "~/server/utils/auth" ;
6
6
7
7
export default eventHandler ( async ( event ) => {
8
- console . log ( " 🔥 hit the github callback url" ) ;
9
8
const query = getQuery ( event ) ;
10
9
const code = query . code ?. toString ( ) ?? null ;
11
10
const state = query . state ?. toString ( ) ?? null ;
@@ -33,16 +32,11 @@ export default eventHandler(async (event) => {
33
32
githubId : true ,
34
33
} ,
35
34
} ) ;
36
- console . log ( " 🔥 existingUser" , { existingUser } ) ;
37
35
38
36
if ( existingUser ) {
39
37
const session = await lucia . createSession ( existingUser . id , { } ) ;
40
38
const cookie = lucia . createSessionCookie ( session . id ) ;
41
39
setCookie ( event , cookie . name , cookie . value , cookie . attributes ) ;
42
- console . log (
43
- " 🔥 redirecting to" ,
44
- `/o/${ existingUser . username . toLocaleLowerCase ( ) } `
45
- ) ;
46
40
return await sendRedirect (
47
41
event ,
48
42
`/o/${ existingUser . username . toLocaleLowerCase ( ) } `
@@ -72,7 +66,6 @@ export default eventHandler(async (event) => {
72
66
setCookie ( event , cookie . name , cookie . value , cookie . attributes ) ;
73
67
return await sendRedirect ( event , `/o/${ githubUser . login . toLowerCase ( ) } ` ) ;
74
68
} catch ( e ) {
75
- console . error ( " 🔥 error" , e ) ;
76
69
if (
77
70
e instanceof OAuth2RequestError &&
78
71
e . message === "bad_verification_code"
0 commit comments