mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 18:14:53 +02:00
added resource auth status cards and moved login to reusable login form
This commit is contained in:
parent
795c144e1e
commit
78b23a8956
14 changed files with 507 additions and 454 deletions
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue