Skip to content

Commit

Permalink
revert: fixed oauth issue, reverting prev commits
Browse files Browse the repository at this point in the history
  • Loading branch information
NoorFatima01 committed May 6, 2024
1 parent 08fa550 commit a6af57a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
14 changes: 3 additions & 11 deletions src/components/login-buttons/google-login-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@ 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();
// eslint-disable-next-line no-console
console.log(`${location.origin}`);

const handleLogin = async () => {
await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
// redirectTo: `https://team-management-weld.vercel.app/}/api/auth/callback?next=${
// props.nextUrl || ''
// }`,
redirectTo: `https://team-management-weld.vercel.app/}/api/auth/callback?next=${
props.nextUrl || ''
}`,
queryParams: {
access_type: 'offline',
prompt: 'consent',
Expand Down
6 changes: 0 additions & 6 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ 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 @@ -24,9 +21,6 @@ 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

0 comments on commit a6af57a

Please sign in to comment.