Skip to content

Commit

Permalink
fix tests and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbjoralt committed Oct 13, 2023
1 parent 8f2ad64 commit 95e3c00
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"start-test": "NEXT_PUBLIC_NO_AUTH=true next dev",
"start-test": "NEXT_PUBLIC_NO_AUTH=true NEXTAUTH_SECRET='insecure-secret' next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NextAuth, { AuthOptions, getServerSession, Session } from "next-auth";
import { AuthOptions, getServerSession, Session } from "next-auth";
import AzureADProvider from "next-auth/providers/azure-ad";

export type CustomSession = {
Expand All @@ -21,8 +21,6 @@ export const authOptions: AuthOptions = {
idToken: true,
}),
],
debug: true,
// TO ENV
session: {
strategy: "jwt",
maxAge: 30 * 24 * 60 * 60, // 30 days
Expand Down Expand Up @@ -51,10 +49,6 @@ export const authOptions: AuthOptions = {
},
};

const handler = NextAuth(authOptions);

export async function getCustomServerSession(authOptions: AuthOptions) {
return (await getServerSession(authOptions)) as CustomSession;
}

export { handler as GET, handler as POST };
3 changes: 1 addition & 2 deletions frontend/src/data/fetchWithToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export async function fetchWithToken<T>(path: string): Promise<T | undefined> {

if (!session || !session.access_token) return;

const apiBackendUrl =
process.env.BACKEND_URL ?? "http://localhost:7172/v0";
const apiBackendUrl = process.env.BACKEND_URL ?? "http://localhost:7172/v0";

// @ts-ignore
const headers = new Headers();
Expand Down

0 comments on commit 95e3c00

Please sign in to comment.