Skip to content

Commit a9a0fa5

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ 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) => {
305+
if (current === newUser) {
306+
return true;
307+
}
308+
305309
if (superUser) {
306310
return current === superUser;
307311
}

0 commit comments

Comments
 (0)