mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-21 12:09:04 +02:00
♻️ refactor
This commit is contained in:
@@ -1,45 +1,44 @@
|
|||||||
import { Request, Response, NextFunction } from "express";
|
import { isLicensedOrSubscribed } from "#dynamic/lib/isLicencedOrSubscribed";
|
||||||
import { z } from "zod";
|
import { unwrapRoleMapping } from "@app/lib/idpRoleMapping";
|
||||||
import { db, Org, primaryDb } from "@server/db";
|
|
||||||
import response from "@server/lib/response";
|
|
||||||
import HttpCode from "@server/types/HttpCode";
|
|
||||||
import createHttpError from "http-errors";
|
|
||||||
import logger from "@server/logger";
|
|
||||||
import { fromError } from "zod-validation-error";
|
|
||||||
import {
|
|
||||||
idp,
|
|
||||||
idpOidcConfig,
|
|
||||||
idpOrg,
|
|
||||||
orgs,
|
|
||||||
Role,
|
|
||||||
roles,
|
|
||||||
userOrgRoles,
|
|
||||||
userOrgs,
|
|
||||||
users
|
|
||||||
} from "@server/db";
|
|
||||||
import { and, eq, inArray } from "drizzle-orm";
|
|
||||||
import * as arctic from "arctic";
|
|
||||||
import { generateOidcRedirectUrl } from "@server/lib/idp/generateRedirectUrl";
|
|
||||||
import jmespath from "jmespath";
|
|
||||||
import jsonwebtoken from "jsonwebtoken";
|
|
||||||
import config from "@server/lib/config";
|
|
||||||
import {
|
import {
|
||||||
createSession,
|
createSession,
|
||||||
generateId,
|
generateId,
|
||||||
generateSessionToken,
|
generateSessionToken,
|
||||||
serializeSessionCookie
|
serializeSessionCookie
|
||||||
} from "@server/auth/sessions/app";
|
} from "@server/auth/sessions/app";
|
||||||
import { decrypt } from "@server/lib/crypto";
|
|
||||||
import { UserType } from "@server/types/UserTypes";
|
|
||||||
import { LimitId } from "@server/lib/billing";
|
|
||||||
import { usageService } from "@server/lib/billing/usageService";
|
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { calculateUserClientsForOrgs } from "@server/lib/calculateUserClientsForOrgs";
|
import {
|
||||||
import { isSubscribed } from "#dynamic/lib/isSubscribed";
|
db,
|
||||||
import { isLicensedOrSubscribed } from "#dynamic/lib/isLicencedOrSubscribed";
|
idp,
|
||||||
|
idpOidcConfig,
|
||||||
|
idpOrg,
|
||||||
|
Org,
|
||||||
|
orgs,
|
||||||
|
roles,
|
||||||
|
userOrgRoles,
|
||||||
|
userOrgs,
|
||||||
|
users
|
||||||
|
} from "@server/db";
|
||||||
|
import { LimitId } from "@server/lib/billing";
|
||||||
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
||||||
|
import { usageService } from "@server/lib/billing/usageService";
|
||||||
|
import { calculateUserClientsForOrgs } from "@server/lib/calculateUserClientsForOrgs";
|
||||||
|
import config from "@server/lib/config";
|
||||||
|
import { decrypt } from "@server/lib/crypto";
|
||||||
|
import { generateOidcRedirectUrl } from "@server/lib/idp/generateRedirectUrl";
|
||||||
|
import response from "@server/lib/response";
|
||||||
import { assignUserToOrg, removeUserFromOrg } from "@server/lib/userOrg";
|
import { assignUserToOrg, removeUserFromOrg } from "@server/lib/userOrg";
|
||||||
import { unwrapRoleMapping } from "@app/lib/idpRoleMapping";
|
import logger from "@server/logger";
|
||||||
|
import HttpCode from "@server/types/HttpCode";
|
||||||
|
import { UserType } from "@server/types/UserTypes";
|
||||||
|
import * as arctic from "arctic";
|
||||||
|
import { and, eq, inArray } from "drizzle-orm";
|
||||||
|
import { NextFunction, Request, Response } from "express";
|
||||||
|
import createHttpError from "http-errors";
|
||||||
|
import jmespath from "jmespath";
|
||||||
|
import jsonwebtoken from "jsonwebtoken";
|
||||||
|
import { z } from "zod";
|
||||||
|
import { fromError } from "zod-validation-error";
|
||||||
|
|
||||||
const ensureTrailingSlash = (url: string): string => {
|
const ensureTrailingSlash = (url: string): string => {
|
||||||
return url;
|
return url;
|
||||||
|
|||||||
Reference in New Issue
Block a user