From f61ed2fb26473d353e5c5cce7effe57ef0f2a42f Mon Sep 17 00:00:00 2001 From: Aiden Foxx Date: Mon, 17 Jan 2022 22:25:56 +0100 Subject: [PATCH] Fixed broken auth SQL on Oracle (#11077) * Fixed broken auth SQL on Oracle * Fix JS context issue * Make linter happy --- api/src/services/authentication.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/services/authentication.ts b/api/src/services/authentication.ts index a639ec81c5..50889f8f5a 100644 --- a/api/src/services/authentication.ts +++ b/api/src/services/authentication.ts @@ -273,7 +273,9 @@ export class AuthenticationService { .from('directus_sessions AS s') .leftJoin('directus_users AS u', 's.user', 'u.id') .leftJoin('directus_shares AS d', 's.share', 'd.id') - .joinRaw('LEFT JOIN directus_roles AS r ON r.id IN (u.role, d.role)') + .leftJoin('directus_roles AS r', function () { + this.onIn('r.id', ['u.role', 'd.role']); + }) .where('s.token', refreshToken) .andWhere('s.expires', '>=', new Date()) .andWhere((subQuery) => {