fix: Users should not be redirected to disabled authentication providers (#5055
* fix: Users should not be redirected to disabled authentication providers Re-enabled tests in plugin directory * Fix plugin http tests
This commit is contained in:
@@ -36,6 +36,7 @@ import parseAttachmentIds from "@server/utils/parseAttachmentIds";
|
||||
import { ValidationError } from "../errors";
|
||||
import ApiKey from "./ApiKey";
|
||||
import Attachment from "./Attachment";
|
||||
import AuthenticationProvider from "./AuthenticationProvider";
|
||||
import Collection from "./Collection";
|
||||
import CollectionUser from "./CollectionUser";
|
||||
import NotificationSetting from "./NotificationSetting";
|
||||
@@ -71,8 +72,18 @@ export enum UserRole {
|
||||
withAuthentications: {
|
||||
include: [
|
||||
{
|
||||
separate: true,
|
||||
model: UserAuthentication,
|
||||
as: "authentications",
|
||||
include: [
|
||||
{
|
||||
model: AuthenticationProvider,
|
||||
as: "authenticationProvider",
|
||||
where: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -53,8 +53,9 @@ api.use(apiWrapper());
|
||||
api.use(editor());
|
||||
|
||||
// register package API routes before others to allow for overrides
|
||||
const rootDir = env.ENVIRONMENT === "test" ? "" : "build";
|
||||
glob
|
||||
.sync("build/plugins/*/server/api/!(*.test).js")
|
||||
.sync(path.join(rootDir, "plugins/*/server/api/!(*.test).[jt]s"))
|
||||
.forEach((filePath: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pkg: Router = require(path.join(process.cwd(), filePath)).default;
|
||||
|
||||
Reference in New Issue
Block a user