chore: update various components and services for improved functionality and consistency, including formatting adjustments and minor refactors
This commit is contained in:
@@ -4,11 +4,11 @@ import logger from "@/lib/logger";
|
||||
|
||||
export async function getAuthSession(request: NextRequest) {
|
||||
try {
|
||||
const token = await getToken({
|
||||
const token = await getToken({
|
||||
req: request,
|
||||
secret: process.env.NEXTAUTH_SECRET,
|
||||
});
|
||||
|
||||
|
||||
if (!token) {
|
||||
return null;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ export async function getAuthSession(request: NextRequest) {
|
||||
id: token.sub!,
|
||||
email: token.email!,
|
||||
roles: JSON.parse(token.roles as string),
|
||||
}
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
logger.error({ err: error }, "Auth error in middleware");
|
||||
|
||||
Reference in New Issue
Block a user