fixed a bit

This commit is contained in:
bobbert committed 2025-03-12 02:12:47 +00:00
1 parent 4ed0480d08
commit 028cffc033
5 files changed
+42 -18

No files matched your search

+11 -16
View File
@@ -3,6 +3,7 @@ import CredentialsProvider from "next-auth/providers/credentials";
import { validateCredentials } from "@/actions/auth";
export const authOptions = {
debug: process.env.NODE_ENV === "development",
providers: [
CredentialsProvider({
id: "credentials",
@@ -12,21 +13,19 @@ export const authOptions = {
password: { label: "Password", type: "password" },
},
async authorize(credentials) {
try {
if (!credentials?.username || !credentials?.password) {
return null;
}
if (!credentials?.username || !credentials?.password) return null;
const user = await validateCredentials(
credentials.username,
credentials.password
);
return user;
} catch (error) {
console.error("Auth error:", error);
return null;
return user
? {
id: user.id,
username: user.username,
role: user.role,
teamId: user.teamId,
}
: null;
},
}),
],
@@ -51,12 +50,8 @@ export const authOptions = {
return session;
},
},
pages: {
signIn: "/login",
},
session: {
strategy: "jwt",
},
pages: { signIn: "/login" },
session: { strategy: "jwt", maxAge: 30 * 24 * 60 * 60 },
secret: process.env.NEXTAUTH_SECRET,
};
+1 -1
View File
@@ -4,7 +4,7 @@ import { NextAuthProvider } from "./providers";
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<body suppressHydrationWarning={true}>
<NextAuthProvider>{children}</NextAuthProvider>
</body>
</html>
+1 -1
View File
@@ -1,4 +1,4 @@
'use client';
"use client";
import { SessionProvider } from "next-auth/react";
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"
#Specify inspection profile for code analysis
profile:
name: qodana.starter
#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>
#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-js:2024.3