mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 14:59:21 +08:00
Fix logout action when no local authentication provider (#2435)
This commit is contained in:
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) {
|
||||
|
||||
Reference in New Issue
Block a user