Skip to content

Commit

Permalink
fix: cookie in same domain as in Unleash
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier committed Oct 11, 2024
1 parent 5d61b39 commit f67f97c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/middleware/authorization-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { LogProvider } from '../logger';
import { AuthenticationRequired } from '../server-impl';
import UnauthorizedError from '../error/unauthorized-error';

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
const authorizationMiddleware = (
getLogger: LogProvider,
baseUriPath: string,
Expand All @@ -13,7 +12,7 @@ const authorizationMiddleware = (
logger.debug('Enabling Authorization middleware');

return async (req: IAuthRequest, res: Response, next: NextFunction) => {
if (req.session?.user) {
if (!req.user?.isAPI && req.session?.user) {
req.user = req.session.user;
return next();
}
Expand Down

0 comments on commit f67f97c

Please sign in to comment.