refactor: next-auth does not support api versioning

This commit is contained in:
Ravinou 2025-04-19 22:35:23 +02:00
commit a3d156bdbf
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7
21 changed files with 20 additions and 20 deletions

View file

@ -1,7 +1,7 @@
import Head from 'next/head';
import 'react-toastify/dist/ReactToastify.css';
import { useSession } from 'next-auth/react';
import { authOptions } from '../api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { GetServerSidePropsContext } from 'next';
import { SessionStatus } from '~/types';

View file

@ -1,5 +1,5 @@
import { ConfigService } from '~/services';
import { authOptions } from '../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import { EmailSettingDTO, ErrorResponse } from '~/types';

View file

@ -1,4 +1,4 @@
import { authOptions } from '../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { ConfigService, AuthService } from '~/services';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';

View file

@ -1,5 +1,5 @@
import { ConfigService } from '~/services';
import { authOptions } from '../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import { ErrorResponse, UsernameSettingDTO } from '~/types';

View file

@ -1,4 +1,4 @@
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import { ErrorResponse, WizardEnvEnum, WizardEnvType } from '~/types';

View file

@ -1,4 +1,4 @@
import { authOptions } from '../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import ApiResponse from '~/helpers/functions/apiResponse';

View file

@ -2,7 +2,7 @@ import { NextApiRequest, NextApiResponse } from 'next';
import { getServerSession } from 'next-auth/next';
import { ConfigService } from '~/services';
import { ErrorResponse, AppriseAlertResponse } from '~/types';
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import ApiResponse from '~/helpers/functions/apiResponse';
export default async function handler(

View file

@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { getServerSession } from 'next-auth/next';
import { ConfigService } from '~/services';
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { AppriseModeDTO, ErrorResponse } from '~/types';
import ApiResponse from '~/helpers/functions/apiResponse';

View file

@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { getServerSession } from 'next-auth/next';
import { ConfigService } from '~/services';
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { AppriseServicesDTO, ErrorResponse } from '~/types';
import ApiResponse from '~/helpers/functions/apiResponse';

View file

@ -4,7 +4,7 @@ import { getServerSession } from 'next-auth/next';
import { promisify } from 'util';
import { ConfigService } from '~/services';
import { ErrorResponse, SuccessResponse } from '~/types';
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
const execAsync = promisify(exec);

View file

@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { getServerSession } from 'next-auth/next';
import { ConfigService } from '~/services';
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { EmailAlertDTO, ErrorResponse } from '~/types';
import ApiResponse from '~/helpers/functions/apiResponse';

View file

@ -1,4 +1,4 @@
import { authOptions } from '../../auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import emailTest from '~/helpers/templates/emailTest';

View file

@ -1,4 +1,4 @@
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import { BorgWarehouseApiResponse, Repository } from '~/types';

View file

@ -1,4 +1,4 @@
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { NextApiRequest, NextApiResponse } from 'next';
import { BorgWarehouseApiResponse, Repository } from '~/types';

View file

@ -1,4 +1,4 @@
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { useSession } from 'next-auth/react';
import Head from 'next/head';

View file

@ -5,7 +5,7 @@ import { useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { SpinnerDotted } from 'spinners-react';
import { useFormStatus } from '~/hooks';
import { authOptions } from './api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
//Components
import { GetServerSidePropsContext } from 'next';

View file

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from 'next';
import RepoList from '~/Containers/RepoList/RepoList';
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
export default function Add() {

View file

@ -1,6 +1,6 @@
import { GetServerSidePropsContext } from 'next';
import RepoList from '~/Containers/RepoList/RepoList';
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
export default function Add() {

View file

@ -1,5 +1,5 @@
import Head from 'next/head';
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { GetServerSidePropsContext } from 'next';

View file

@ -1,7 +1,7 @@
import SetupWizard from '../../Containers/SetupWizard/SetupWizard';
import { useRouter } from 'next/router';
import Head from 'next/head';
import { authOptions } from '~/pages/api/v1/auth/[...nextauth]';
import { authOptions } from '~/pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { GetServerSidePropsContext } from 'next';