feat: Add find by auth method to App model

This commit is contained in:
Faruk AYDIN
2024-02-27 16:24:17 +01:00
parent 0031d7911d
commit 63c9442126

View File

@@ -39,6 +39,13 @@ class App {
return appInfoConverter(rawAppData); return appInfoConverter(rawAppData);
} }
static async findAuthByKey(key, stripFuncs = false) {
const rawAppData = await getApp(key, stripFuncs);
const appData = appInfoConverter(rawAppData);
return appData.auth;
}
static async checkAppAndAction(appKey, actionKey) { static async checkAppAndAction(appKey, actionKey) {
const app = await this.findOneByKey(appKey); const app = await this.findOneByKey(appKey);