Skip to content

Commit

Permalink
fix: trying to solve oauth error in production using console statements
Browse files Browse the repository at this point in the history
  • Loading branch information
NoorFatima01 committed May 6, 2024
1 parent 5d93591 commit ac96011
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/components/login-buttons/google-login-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { createSupabaseBrowserClient } from '@/lib/supabase/browser-clients';
import { Button } from '@/components/ui/button';

export default function LoginWithGoogleButton(props: { nextUrl?: string }) {
// eslint-disable-next-line no-console
console.log('props', props);
// eslint-disable-next-line no-console
console.log('props.nextUrl', props.nextUrl);
// eslint-disable-next-line no-console
console.log(`${location.origin}/api/auth/callback?next=${props.nextUrl}`);
const supabase = createSupabaseBrowserClient();

const handleLogin = async () => {
Expand Down
6 changes: 6 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export async function middleware(request: NextRequest) {
},
});

// eslint-disable-next-line no-console
console.log('middleware', request.url, request.method, request.headers);

const supabase = createSupabaseReqResClient(request, response);

const {
Expand All @@ -21,6 +24,9 @@ export async function middleware(request: NextRequest) {
return NextResponse.redirect(new URL('/', request.url));
}

// eslint-disable-next-line no-console
console.log('response', response);

return response;
}

Expand Down
6 changes: 3 additions & 3 deletions supabase/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ file_size_limit = "50MiB"
enabled = true
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
# in emails.
site_url = env(SITE_URL)
site_url = "env(SITE_URL)"
# A list of exact URLs that auth providers are permitted to redirect to post authentication.
additional_redirect_urls = [env(SITE_URL)]
additional_redirect_urls = ["env(SITE_URL)"]
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
jwt_expiry = 3600
# If disabled, the refresh token will never expire.
Expand Down Expand Up @@ -164,4 +164,4 @@ s3_secret_key = "env(S3_SECRET_KEY)"
enabled = true
client_id = "env(GOOGLE_CLIENT_ID)"
secret = "env(GOOGLE_SECRET)"
redirect_uri = env(NEXT_PUBLIC_SUPABASE_REDIRECT_URI)
redirect_uri = "env(NEXT_PUBLIC_SUPABASE_REDIRECT_URI)"

0 comments on commit ac96011

Please sign in to comment.