File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,18 +25,25 @@ export default function SocialButtons({
2525 const supabase = getSupabaseBrowserClient ( ) ;
2626 const pathname = usePathname ( ) ;
2727 const oauthRedirectUrl = useMemo ( ( ) => {
28- if ( ! process . env . NEXT_PUBLIC_ROOT_URL ) {
29- return undefined ;
30- }
28+ const lang = pathname ?. split ( '/' ) [ 1 ] || 'en' ;
29+ const siteOrigin =
30+ ( typeof window !== 'undefined' && window . location . origin ) ||
31+ process . env . NEXT_PUBLIC_ROOT_URL ;
32+ const supabaseBase = process . env . NEXT_PUBLIC_SUPABASE_URL ;
3133
32- const normalizedRoot = process . env . NEXT_PUBLIC_ROOT_URL . replace ( / \/ $ / , '' ) ;
34+ if ( ! siteOrigin || ! supabaseBase ) return undefined ;
35+
36+ const normalizedSiteOrigin = siteOrigin . replace ( / \/ $ / , '' ) ;
37+ const normalizedSupabase = supabaseBase . replace ( / \/ $ / , '' ) ;
3338
3439 // If we're on the sign-in page, redirect to home after successful login
3540 const nextPath = pathname ?. includes ( '/sign-in' )
3641 ? pathname . replace ( / \/ s i g n - i n .* $ / , '' ) || '/'
3742 : pathname || '/' ;
3843
39- return `${ normalizedRoot } /auth/callback?next=${ encodeURIComponent ( nextPath ) } ` ;
44+ const nextUrl = `${ normalizedSiteOrigin } ${ nextPath } ` ;
45+ const nextParam = encodeURIComponent ( `${ nextUrl } ?lang=${ lang } ` ) ;
46+ return `${ normalizedSupabase } /auth/v1/callback?redirect_to=${ nextParam } ` ;
4047 } , [ pathname ] ) ;
4148
4249 const socialButtons : SocialButton [ ] = [
Original file line number Diff line number Diff line change @@ -1499,11 +1499,6 @@ input[type='search']::-webkit-search-decoration,
14991499 min-width : 70px ;
15001500}
15011501
1502- .min-w-fit {
1503- min-width : -moz-fit-content;
1504- min-width : fit-content;
1505- }
1506-
15071502.min-w-full {
15081503 min-width : 100% ;
15091504}
You can’t perform that action at this time.
0 commit comments