Skip to content

Commit 25617a6

Browse files
committed
provider-types
1 parent 9ee00cb commit 25617a6

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

app/auth/login/page.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import SignInButton from '@/components/SignInButton';
22
import { getFetchUrl } from '@/lib/utils';
3+
import { CommonProviderOptions } from 'next-auth/providers';
34

45
async function LoginPage() {
56
const res = await fetch(`${getFetchUrl()}/api/auth/providers`);
6-
7-
if (!res.ok) throw new Error(`Providers Not Found.`);
8-
9-
const providers: Provider[] = await res.json();
7+
const providers: CommonProviderOptions = await res.json();
108

119
return (
1210
<div className="grid grid-cols-2 gap-3 mt-5">

components/SignInButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { getFetchUrl } from '@/lib/utils';
22
import { Button } from './ui/button';
33
import { signIn } from '@/lib/auth';
4+
import { CommonProviderOptions } from 'next-auth/providers';
45

5-
function SignInButton({ provider }: { provider: Provider }) {
6-
console.log(process.env.VERCEL_ENV);
6+
function SignInButton({ provider }: { provider: CommonProviderOptions }) {
77
return (
88
<form>
99
<Button

types/getProviders.ts

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
interface Provider {
2-
id: string;
3-
type: string;
4-
name: string;
5-
callbackUrl: string;
6-
}

0 commit comments

Comments
 (0)