Fix logout action when no local authentication provider (#2435)

This commit is contained in:
Cristian Dean
2019-07-30 20:39:30 -03:00
committed by Wyatt Johnson
parent 7b7cec5258
commit b108faed5e
@@ -1,10 +1,9 @@
import { AppOptions } from "coral-server/app";
import { handleLogout } from "coral-server/app/middleware/passport";
import { IntegrationDisabled } from "coral-server/errors";
import { RequestHandler } from "coral-server/types/express";
export * from "./signup";
export * from "./forgot";
export * from "./signup";
export type LogoutOptions = Pick<AppOptions, "redis">;
@@ -12,14 +11,6 @@ export const logoutHandler = ({
redis,
}: LogoutOptions): RequestHandler => async (req, res, next) => {
try {
// Tenant is guaranteed at this point.
const tenant = req.coral!.tenant!;
// Check to ensure that the local integration has been enabled.
if (!tenant.auth.integrations.local.enabled) {
throw new IntegrationDisabled("local");
}
// Get the user on the request.
const user = req.user;
if (!user) {