diff --git a/apps/e2e/tests/js/auth-like.test.ts b/apps/e2e/tests/js/auth-like.test.ts index 453721a02..f8965e983 100644 --- a/apps/e2e/tests/js/auth-like.test.ts +++ b/apps/e2e/tests/js/auth-like.test.ts @@ -13,6 +13,22 @@ const signIn = async (clientApp: any) => { }); }; +// ============================================ +// version tests +// ============================================ + +it("clientApp.version should return a valid semver version string", async ({ expect }) => { + const { clientApp } = await createApp({}); + expect(clientApp.version).toBeDefined(); + expect(typeof clientApp.version).toBe("string"); + expect(clientApp.version).toMatch(/^\d+\.\d+\.\d+/); +}); + +it("serverApp.version should return the same version as clientApp", async ({ expect }) => { + const { clientApp, serverApp } = await createApp({}); + expect(serverApp.version).toBe(clientApp.version); +}); + // ============================================ // getAccessToken / getRefreshToken tests // ============================================ diff --git a/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts b/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts index 238ec9111..2c76f159e 100644 --- a/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts +++ b/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts @@ -1916,6 +1916,10 @@ export class _StackClientAppImplIncomplete { // TODO: At some point, we should use the project's trusted domains for this instead of just requiring the URL to be relative // (note that when we do this, that should be on-top of the relativity check, not replacing it) diff --git a/packages/template/src/lib/stack-app/apps/interfaces/client-app.ts b/packages/template/src/lib/stack-app/apps/interfaces/client-app.ts index 79006b412..729b718b9 100644 --- a/packages/template/src/lib/stack-app/apps/interfaces/client-app.ts +++ b/packages/template/src/lib/stack-app/apps/interfaces/client-app.ts @@ -47,6 +47,11 @@ export type StackClientApp, signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise,