@@ -3,7 +3,6 @@ import { fromHexString } from '../../utils/encrypt';
33export const prerender = false ;
44
55const GITHUB_OAUTH_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token' ;
6- const TOKEN_VALIDITY_PERIOD = 1000 * 60 * 60 * 24 * 365 ; // 1 year;
76
87export async function GET ( { url, redirect, cookies} ) {
98
@@ -17,8 +16,6 @@ export async function GET({ url, redirect, cookies}) {
1716
1817 const redirectUrl = new URL ( fromHexString ( state ) ) ;
1918
20- console . log ( 'Authorized' , GITHUB_CLIENT_ID ) ;
21-
2219 if ( error && error === 'access_denied' ) {
2320 redirect ( redirectUrl . href , 302 ) ;
2421 return ;
@@ -51,14 +48,11 @@ export async function GET({ url, redirect, cookies}) {
5148 status : 503
5249 }
5350 )
54- return ;
5551 }
5652
57- // cookies.set('token', accessToken, { expires: new Date(Date.now() + TOKEN_VALIDITY_PERIOD), secure: true, httpOnly: true, path: '/' });
5853 cookies . set ( 'refresh' , refreshToken , { secure : true , httpOnly : true , path : '/' } ) ;
5954
6055 redirectUrl . searchParams . set ( 'token' , accessToken ) ;
61- // redirectUrl.searchParams.set('refresh', refreshToken);
6256
6357 return redirect ( redirectUrl . href , 302 ) ;
6458}
0 commit comments