File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed
Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,12 @@ export default function SocialButtons({
3131
3232 const normalizedRoot = process . env . NEXT_PUBLIC_ROOT_URL . replace ( / \/ $ / , '' ) ;
3333
34- return `${ normalizedRoot } /auth/callback?next=${ encodeURIComponent ( pathname || '/' ) } ` ;
34+ // If we're on the sign-in page, redirect to home after successful login
35+ const nextPath = pathname ?. includes ( '/sign-in' )
36+ ? pathname . replace ( / \/ s i g n - i n .* $ / , '' ) || '/'
37+ : pathname || '/' ;
38+
39+ return `${ normalizedRoot } /auth/callback?next=${ encodeURIComponent ( nextPath ) } ` ;
3540 } , [ pathname ] ) ;
3641
3742 const socialButtons : SocialButton [ ] = [
Original file line number Diff line number Diff line change 11import type { ReactElement } from 'react' ;
22
3- import { revalidatePath } from 'next/cache' ;
43import { getDoobooStats } from '../../../../server/services/githubService' ;
54import { getTranslates } from '../../../../src/localization' ;
65import Container from '../Container' ;
@@ -26,8 +25,6 @@ export default async function Page(props: Props): Promise<ReactElement> {
2625 lang,
2726 } ) ;
2827
29- revalidatePath ( '/stats' , 'page' ) ;
30-
3128 return (
3229 < Container
3330 t = { tStats }
Original file line number Diff line number Diff line change @@ -78,6 +78,6 @@ export async function proxy(
7878}
7979
8080export const config = {
81- // Matcher ignoring `/_next/`, `/api/` and `/assets/`
82- matcher : [ '/((?!api|assets|_next/static|_next/image|favicon.ico|public).*)' ] ,
81+ // Matcher ignoring `/_next/`, `/api/`, `/auth/` and `/assets/`
82+ matcher : [ '/((?!api|auth| assets|_next/static|_next/image|favicon.ico|public).*)' ] ,
8383} ;
Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ export const getDoobooStats = async ({
608608 } )
609609 . match ( { login : userPlugin . login } ) ;
610610
611- if ( ! updatedAt || diffHours ( updatedAt , today ) < 3 ) {
611+ if ( ! updatedAt || diffHours ( updatedAt , today ) > 3 ) {
612612 void upsertGithubStats ( {
613613 plugin,
614614 user_plugin : userPlugin ,
@@ -651,6 +651,12 @@ export const getDoobooStats = async ({
651651 lang,
652652 } ) ;
653653 } catch ( e : any ) {
654- throw new Error ( e ) ;
654+ console . error ( 'Error in getDoobooStats:' , {
655+ login,
656+ error : e . message || e ,
657+ stack : e . stack ,
658+ } ) ;
659+
660+ return null ;
655661 }
656662} ;
You can’t perform that action at this time.
0 commit comments