Skip to content

Commit 69bc8c4

Browse files
Fix type: use StackServerApp<true, "internal"> to preserve internal user type
The getStackServerApp() was typed as plain StackServerApp (defaults to <boolean, string>), losing the 'internal' ProjectId type parameter. This caused getUser() to return CurrentServerUser instead of CurrentInternalServerUser, which doesn't have listOwnedProjects. Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
1 parent 0736a0d commit 69bc8c4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/dashboard/src/stack/server.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { StackServerApp } from "@stackframe/stack";
55
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
66
import { stackClientApp } from "./client";
77

8-
let _stackServerApp: StackServerApp | undefined;
8+
type InternalServerApp = StackServerApp<true, "internal">;
9+
let _stackServerApp: InternalServerApp | undefined;
910

10-
export function getStackServerApp(): StackServerApp {
11+
export function getStackServerApp(): InternalServerApp {
1112
if (!_stackServerApp) {
1213
if (isRemoteDevelopmentEnvironmentEnabled()) {
1314
throw new StackAssertionError("stackServerApp is not available in the local remote development environment dashboard.");

0 commit comments

Comments
 (0)