Update 8 files

- /src/app/admin/login/AdminLoginClient.tsx
- /src/app/admin/login/page.tsx
- /src/api.ts
- /src/app/api/auth/[...nextauth]/route.ts
- /src/lib/api.ts
- /src/lib/auth.ts
- /src/components/MovieCard.tsx
- /src/components/MoviePlayer.tsx
This commit is contained in:
2024-12-24 14:58:59 +00:00
parent 2bdea011b6
commit ca9d2002fc
8 changed files with 16 additions and 180 deletions

View File

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

View File

@@ -64,6 +64,7 @@ export const authOptions: AuthOptions = {
},
session: {
strategy: 'jwt',
maxAge: 30 * 24 * 60 * 60, // 30 дней
},
};
@@ -87,3 +88,4 @@ declare module 'next-auth/jwt' {
isAdmin: boolean;
}
}