mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
stackApp.version
This commit is contained in:
parent
45e8eddd70
commit
fd79f626d3
@ -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
|
||||
// ============================================
|
||||
|
||||
@ -1916,6 +1916,10 @@ export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, Projec
|
||||
return this._interface.projectId as ProjectId;
|
||||
}
|
||||
|
||||
get version(): string {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
protected async _isTrusted(url: string): Promise<boolean> {
|
||||
// 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)
|
||||
|
||||
@ -47,6 +47,11 @@ export type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId ex
|
||||
& {
|
||||
readonly projectId: ProjectId,
|
||||
|
||||
/**
|
||||
* The version of the Stack Auth SDK.
|
||||
*/
|
||||
readonly version: string,
|
||||
|
||||
readonly urls: Readonly<HandlerUrls>,
|
||||
|
||||
signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user