feat: add async suffix eslint rule (#485)

This commit is contained in:
Manuel
2024-05-18 12:25:33 +02:00
committed by GitHub
parent 5723295856
commit dcaff1d91c
60 changed files with 296 additions and 225 deletions

View File

@@ -3,7 +3,7 @@ import type { Session } from "@auth/core/types";
import type { Database } from "@homarr/db";
import { getCurrentUserPermissions } from "./callbacks";
import { getCurrentUserPermissionsAsync } from "./callbacks";
export const sessionMaxAgeInSeconds = 30 * 24 * 60 * 60; // 30 days
export const sessionTokenCookieName = "next-auth.session-token";
@@ -16,7 +16,7 @@ export const generateSessionToken = () => {
return randomUUID();
};
export const getSessionFromToken = async (
export const getSessionFromTokenAsync = async (
db: Database,
token: string | undefined,
): Promise<Session | null> => {
@@ -48,7 +48,7 @@ export const getSessionFromToken = async (
return {
user: {
...session.user,
permissions: await getCurrentUserPermissions(db, session.user.id),
permissions: await getCurrentUserPermissionsAsync(db, session.user.id),
},
expires: session.expires.toISOString(),
};