Skip to content

Commit d91c06d

Browse files
committed
fix: add base websocketTopicAuth in CLI app template
AdminForth/1830/ws-authorization-work
1 parent c771885 commit d91c06d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

adminforth/commands/createApp/templates/index.ts.hbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ export const admin = new AdminForth({
2626
return "Please use <b>adminforth</b> as username and <b>adminforth</b> as password"
2727
}
2828
},
29+
websocketTopicAuth: async (topic: string, adminUser: AdminUser) => {
30+
if (!adminUser) {
31+
// don't allow anonymous users to subscribe
32+
return false;
33+
}
34+
return true;
35+
}
2936
},
3037
customization: {
3138
brandName: "{{appName}}",

0 commit comments

Comments
 (0)