mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
refactor(core): fix rls error alert message (#3103)
This commit is contained in:
parent
9c7bd2d0a8
commit
2b7da7b228
1 changed files with 4 additions and 2 deletions
|
@ -49,10 +49,12 @@ export const checkRowLevelSecurity = async (client: QueryClient) => {
|
|||
and rowsecurity=false
|
||||
`);
|
||||
|
||||
if (rows.some(({ tablename }) => tablename !== Systems.table)) {
|
||||
const rlsDisabled = rows.filter(({ tablename }) => tablename !== Systems.table);
|
||||
|
||||
if (rlsDisabled.length > 0) {
|
||||
throw new Error(
|
||||
'Row-level security has to be enforced on EVERY business table when starting Logto.\n' +
|
||||
`Found following table(s) without RLS: ${rows
|
||||
`Found following table(s) without RLS: ${rlsDisabled
|
||||
.map((row) => conditionalString(isKeyInObject(row, 'tablename') && String(row.tablename)))
|
||||
.join(', ')}\n\n` +
|
||||
'Did you forget to run `npm cli db multi-tenancy enable`?'
|
||||
|
|
Loading…
Reference in a new issue