mirror of
https://gitlab.com/foxixus/neomovies.git
synced 2025-10-28 09:58:49 +05:00
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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user