mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
Tighten agent-auth back-compat defaults
Co-Authored-By: madison@stack-auth.com <madison.w.kennedy@gmail.com>
This commit is contained in:
parent
a845c87242
commit
99da207c46
@ -40,7 +40,7 @@ export const ALL_APP_TAGS = {
|
||||
|
||||
type ParentAppId = "authentication" | "analytics";
|
||||
|
||||
type App = {
|
||||
export type App = {
|
||||
displayName: string,
|
||||
subtitle: string,
|
||||
tags: (keyof typeof ALL_APP_TAGS)[],
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { ALL_APPS } from "../apps/apps-config";
|
||||
import { applyOrganizationDefaults } from "./schema";
|
||||
import { expect } from "vitest";
|
||||
import { expect, test } from "vitest";
|
||||
|
||||
import.meta.vitest?.test("agent-auth is absent from default installed apps", () => {
|
||||
test("agent-auth is absent from default installed apps", () => {
|
||||
const defaults = applyOrganizationDefaults({});
|
||||
|
||||
expect(Object.keys(defaults.apps.installed)).not.toContain("agent-auth");
|
||||
});
|
||||
|
||||
import.meta.vitest?.test("agent-auth stays explicitly enableable", () => {
|
||||
test("agent-auth stays explicitly enableable", () => {
|
||||
const defaults = applyOrganizationDefaults({
|
||||
apps: {
|
||||
installed: {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
// OTHERWISE THINGS WILL GO BOOM!!
|
||||
|
||||
import * as yup from "yup";
|
||||
import { ALL_APPS } from "../apps/apps-config";
|
||||
import { ALL_APPS, type App } from "../apps/apps-config";
|
||||
import { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID } from "../helpers/emails";
|
||||
import * as schemaFields from "../schema-fields";
|
||||
import { productSchema, userSpecifiedIdSchema, yupBoolean, yupDate, yupMixed, yupNever, yupNumber, yupObject, yupRecord, yupString, yupTuple, yupUnion } from "../schema-fields";
|
||||
@ -293,13 +293,12 @@ const branchOnboardingSchema = yupObject({
|
||||
requireEmailVerification: yupBoolean(),
|
||||
});
|
||||
|
||||
function isIncludedInDefaultInstalledApps(app: App) {
|
||||
return app.includedInDefaultInstalledApps !== false;
|
||||
}
|
||||
|
||||
const installedAppIdsByDefault = typedEntries(ALL_APPS)
|
||||
.filter(([, app]) => {
|
||||
if ("includedInDefaultInstalledApps" in app) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.filter(([, app]) => isIncludedInDefaultInstalledApps(app))
|
||||
.map(([appId]) => appId);
|
||||
|
||||
export const branchConfigSchema = canNoLongerBeOverridden(projectConfigSchema, [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user