mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-10 04:36:38 +00:00
add license system and ui
This commit is contained in:
@@ -11,6 +11,7 @@ import { idp, idpOidcConfig } from "@server/db/schemas";
|
||||
import { generateOidcRedirectUrl } from "@server/lib/idp/generateRedirectUrl";
|
||||
import { encrypt } from "@server/lib/crypto";
|
||||
import config from "@server/lib/config";
|
||||
import license from "@server/license/license";
|
||||
|
||||
const paramsSchema = z.object({}).strict();
|
||||
|
||||
@@ -67,7 +68,7 @@ export async function createOidcIdp(
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
let {
|
||||
clientId,
|
||||
clientSecret,
|
||||
authUrl,
|
||||
@@ -80,6 +81,10 @@ export async function createOidcIdp(
|
||||
autoProvision
|
||||
} = parsedBody.data;
|
||||
|
||||
if (!(await license.isUnlocked())) {
|
||||
autoProvision = false;
|
||||
}
|
||||
|
||||
const key = config.getRawConfig().server.secret;
|
||||
|
||||
const encryptedSecret = encrypt(clientSecret, key);
|
||||
|
||||
Reference in New Issue
Block a user