Skip to content

Commit 274488b

Browse files
committed
fix(api-gateway): allow switch sql user when the new user is the same
1 parent 9327f70 commit 274488b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cubejs-api-gateway/src/sql-server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ export class SQLServer {
301301
protected createDefaultCanSwitchSqlUserFn(options: SQLServerOptions): CanSwitchSQLUserFn {
302302
const superUser = options.sqlSuperUser || getEnv('sqlSuperUser');
303303

304-
return async (current: string | null, _user: string) => {
304+
return async (current: string | null, newUser: string) => {
305305
if (superUser) {
306-
return current === superUser;
306+
return current === superUser || current === newUser;
307307
}
308308

309309
return false;

0 commit comments

Comments
 (0)