Update 9 files

- /src/api.ts
- /src/app/admin/login/AdminLoginClient.tsx
- /src/app/admin/login/page.tsx
- /src/app/api/auth/[...nextauth]/route.ts
- /src/components/MovieCard.tsx
- /src/components/MoviePlayer.tsx
- /src/components/Navbar.tsx
- /src/lib/api.ts
- /src/lib/auth.ts
This commit is contained in:
2024-12-24 15:15:12 +00:00
parent ca9d2002fc
commit abb4424ba4
9 changed files with 186 additions and 16 deletions

View File

@@ -1,13 +1,17 @@
import axios from 'axios';
const BASE_URL = 'https://api.themoviedb.org/3';
const API_KEY = 'process.env.TMDB_API_KEY';
if (typeof window === 'undefined' && !process.env.NEXT_PUBLIC_TMDB_ACCESS_TOKEN) {
throw new Error('TMDB_ACCESS_TOKEN is not defined in environment variables');
}
export const api = axios.create({
baseURL: BASE_URL,
params: {
api_key: API_KEY,
},
headers: {
'Authorization': `Bearer ${process.env.NEXT_PUBLIC_TMDB_ACCESS_TOKEN}`,
'Content-Type': 'application/json'
}
});
export interface Genre {

View File

@@ -88,4 +88,3 @@ declare module 'next-auth/jwt' {
isAdmin: boolean;
}
}