diff --git a/app/src/App.ts b/app/src/App.ts index b98fc67..d32d57c 100644 --- a/app/src/App.ts +++ b/app/src/App.ts @@ -1,6 +1,7 @@ import type { CreateUserPayload } from "auth/AppAuth"; import { Event } from "core/events"; import { Connection, type LibSqlCredentials, LibsqlConnection } from "data"; +import type { Hono } from "hono"; import { type InitialModuleConfigs, ModuleManager, @@ -132,7 +133,7 @@ export class App { return this.modules.ctx().em; } - get fetch(): any { + get fetch(): Hono["fetch"] { return this.server.fetch; } @@ -155,6 +156,10 @@ export class App { return this.modules.version(); } + isBuilt(): boolean { + return this.modules.isBuilt(); + } + registerAdminController(config?: AdminControllerOptions) { // register admin this.adminController = new AdminController(this, config); diff --git a/app/src/auth/authenticate/Authenticator.ts b/app/src/auth/authenticate/Authenticator.ts index 7b81ed7..19088d9 100644 --- a/app/src/auth/authenticate/Authenticator.ts +++ b/app/src/auth/authenticate/Authenticator.ts @@ -259,7 +259,7 @@ export class Authenticator = Record< } async requestCookieRefresh(c: Context) { - if (this.config.cookie.renew) { + if (this.config.cookie.renew && this.isUserLoggedIn()) { const token = await this.getAuthCookie(c); if (token) { await this.setAuthCookie(c, token); diff --git a/app/src/modules/ModuleManager.ts b/app/src/modules/ModuleManager.ts index efe7a09..b1868fb 100644 --- a/app/src/modules/ModuleManager.ts +++ b/app/src/modules/ModuleManager.ts @@ -171,6 +171,10 @@ export class ModuleManager { } } + isBuilt(): boolean { + return this._built; + } + /** * This is set through module's setListener * It's called everytime a module's config is updated in SchemaObject