Skip to content

Commit

Permalink
fix(api-gateway): allow switch sql user when the new user is the same
Browse files Browse the repository at this point in the history
  • Loading branch information
bsod90 committed Dec 12, 2024
1 parent 546086f commit 61d7828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cubejs-api-gateway/src/sql-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ export class SQLServer {
protected createDefaultCanSwitchSqlUserFn(options: SQLServerOptions): CanSwitchSQLUserFn {
const superUser = options.sqlSuperUser || getEnv('sqlSuperUser');

return async (current: string | null, _user: string) => {
return async (current: string | null, newUser: string) => {
if (current === newUser) {
return true;
}

if (superUser) {
return current === superUser;
}
Expand Down

0 comments on commit 61d7828

Please sign in to comment.