added resource auth status cards and moved login to reusable login form

This commit is contained in:
Milo Schwartz 2024-11-23 17:56:21 -05:00
parent 795c144e1e
commit 78b23a8956
No known key found for this signature in database
14 changed files with 507 additions and 454 deletions

View file

@ -16,6 +16,7 @@ import { and, eq } from "drizzle-orm";
import config from "@server/config";
import { validateResourceSessionToken } from "@server/auth/resource";
import { Resource, roleResources, userResources } from "@server/db/schema";
import logger from "@server/logger";
const verifyResourceSessionSchema = z.object({
sessions: z.object({
@ -44,6 +45,8 @@ export async function verifyResourceSession(
res: Response,
next: NextFunction
): Promise<any> {
logger.debug("Badger sent", req.body); // remove when done testing
const parsedBody = verifyResourceSessionSchema.safeParse(req.body);
if (!parsedBody.success) {

View file

@ -13,6 +13,7 @@ import {
createResourceSession,
serializeResourceSessionCookie,
} from "@server/auth/resource";
import logger from "@server/logger";
export const authWithPasswordBodySchema = z.object({
password: z.string(),
@ -132,9 +133,10 @@ export async function authWithPassword(
resource.fullDomain,
secureCookie
);
res.appendHeader("Set-Cookie", cookie);
logger.debug(cookie); // remove after testing
return response<null>(res, {
data: null,
success: true,