Skip to content

Commit f81ae70

Browse files
committed
fix:move check of the adminforth secret from config validator to the discover databases
AdminForth/1706/fix-bundle-now-command
1 parent 84b7380 commit f81ae70

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

adminforth/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,14 @@ class AdminForth implements IAdminForth {
619619
this.config.resources.forEach((resource) => {
620620
this.operationalResources[resource.resourceId] = new OperationalResource(this.connectors[resource.dataSource], resource);
621621
});
622-
622+
623+
const adminforthSecret = process.env.ADMINFORTH_SECRET;
624+
if (!adminforthSecret) {
625+
throw new Error(`ADMINFORTH_SECRET environment not set
626+
Please set ADMINFORTH_SECRET environment variable to a random string to secure your admin panel.
627+
ADMINFORTH_SECRET variable is used to sign JWT tokens
628+
`);
629+
}
623630
}
624631

625632
async getAllTables(): Promise<{ [dataSourceId: string]: string[] }> {

0 commit comments

Comments
 (0)