Merge dev into docs/ui/openin

This commit is contained in:
Konsti Wohlwend 2025-09-27 06:31:36 -05:00 committed by GitHub
commit 5578cc9d37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 328 additions and 31 deletions

View File

@ -1,5 +1,22 @@
# @stackframe/stack-backend
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-backend",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"clean": "rimraf src/generated && rimraf .next && rimraf node_modules",

View File

@ -1,5 +1,23 @@
# @stackframe/stack-dashboard
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack@2.8.41
- @stackframe/stack-ui@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack@2.8.40
- @stackframe/stack-ui@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-dashboard",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"clean": "rimraf .next && rimraf node_modules",

View File

@ -1,5 +1,9 @@
# @stackframe/dev-launchpad
## 2.8.41
## 2.8.40
## 2.8.39
## 2.8.38

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/dev-launchpad",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "serve -p 8100 -s public",

View File

@ -1,5 +1,22 @@
# @stackframe/e2e-tests
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/js@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/js@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/e2e-tests",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"type": "module",
"scripts": {

View File

@ -1,5 +1,9 @@
# @stackframe/mock-oauth-server
## 2.8.41
## 2.8.40
## 2.8.39
## 2.8.38

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/mock-oauth-server",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"main": "index.js",
"scripts": {

View File

@ -1,5 +1,22 @@
# @stackframe/stack-docs
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-docs",
"version": "2.8.39",
"version": "2.8.41",
"description": "",
"main": "index.js",
"private": true,

View File

@ -1,5 +1,18 @@
# @stackframe/example-cjs-test
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/example-cjs-test",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "next dev --port 8110",

View File

@ -0,0 +1,15 @@
# @stackframe/convex-example
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack@2.8.40

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/convex-example",
"version": "0.1.0",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "npm-run-all --parallel dev:frontend dev:backend",

View File

@ -1,5 +1,23 @@
# @stackframe/example-demo-app
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack@2.8.41
- @stackframe/stack-ui@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack@2.8.40
- @stackframe/stack-ui@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/example-demo-app",
"version": "2.8.39",
"version": "2.8.41",
"description": "",
"private": true,
"scripts": {

View File

@ -1,5 +1,23 @@
# @stackframe/docs-examples
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack@2.8.41
- @stackframe/stack-ui@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack@2.8.40
- @stackframe/stack-ui@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/docs-examples",
"version": "2.8.39",
"version": "2.8.41",
"description": "",
"private": true,
"scripts": {

View File

@ -1,5 +1,18 @@
# @stackframe/e-commerce-demo
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/e-commerce-demo",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "next dev --port 8111",

View File

@ -1,5 +1,18 @@
# @stackframe/js-example
## 2.8.41
### Patch Changes
- @stackframe/js@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/js@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/js-example",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"description": "",
"main": "index.js",

View File

@ -1,5 +1,18 @@
# @stackframe/example-middleware-demo
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/example-middleware-demo",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "next dev --port 8112",

View File

@ -1,5 +1,18 @@
# @stackframe/example-partial-prerendering
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/example-partial-prerendering",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "next dev --port 8109",

View File

@ -1,5 +1,18 @@
# react-example
## 2.8.41
### Patch Changes
- @stackframe/react@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/react@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,7 +1,7 @@
{
"name": "react-example",
"private": true,
"version": "2.8.39",
"version": "2.8.41",
"type": "module",
"scripts": {
"dev": "vite --force --port 8120",

View File

@ -1,5 +1,18 @@
# @stackframe/example-supabase
## 2.8.41
### Patch Changes
- @stackframe/stack@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/example-supabase",
"version": "2.8.39",
"version": "2.8.41",
"private": true,
"scripts": {
"dev": "next dev --turbo --port 8115",

View File

@ -1,5 +1,20 @@
# @stackframe/init-stack
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/init-stack",
"version": "2.8.39",
"version": "2.8.41",
"description": "The setup wizard for Stack. https://stack-auth.com",
"main": "dist/index.js",
"type": "module",

View File

@ -1,7 +1,7 @@
{
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY",
"name": "@stackframe/js",
"version": "2.8.39",
"version": "2.8.41",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY",
"name": "@stackframe/react",
"version": "2.8.39",
"version": "2.8.41",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@ -1,5 +1,9 @@
# @stackframe/stack-sc
## 2.8.41
## 2.8.40
## 2.8.39
## 2.8.38

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-sc",
"version": "2.8.39",
"version": "2.8.41",
"exports": {
"./force-react-server": {
"types": "./dist/index.react-server.d.ts",

View File

@ -1,5 +1,17 @@
# @stackframe/stack-shared
## 2.8.41
### Patch Changes
- Various changes
## 2.8.40
### Patch Changes
- Various changes
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-shared",
"version": "2.8.39",
"version": "2.8.41",
"scripts": {
"build": "rimraf dist && tsup-node",
"typecheck": "tsc --noEmit",

View File

@ -187,7 +187,7 @@ export class StackClientInterface {
throw new StackAssertionError("Access token not found in token endpoint response, this is weird!");
}
return new AccessToken(result.access_token);
return AccessToken.createIfValid(result.access_token) ?? throwErr("Access token in fetchNewAccessToken is invalid, looks like the backend is returning an invalid token!", { result });
}
public async sendClientRequest(

View File

@ -1,14 +1,29 @@
import * as jose from 'jose';
import { InferType } from 'yup';
import { accessTokenPayloadSchema } from './schema-fields';
import { StackAssertionError } from "./utils/errors";
import { StackAssertionError, throwErr } from "./utils/errors";
import { Store } from "./utils/stores";
export type AccessTokenPayload = InferType<typeof accessTokenPayloadSchema>;
function decodeAccessTokenIfValid(token: string): AccessTokenPayload | null {
try {
const payload = jose.decodeJwt(token);
return accessTokenPayloadSchema.validateSync(payload);
} catch (e) {
return null;
}
}
export class AccessToken {
constructor(
static createIfValid(token: string): AccessToken | null {
const payload = decodeAccessTokenIfValid(token);
if (!payload) return null;
return new AccessToken(token);
}
private constructor(
public readonly token: string,
) {
if (token === "undefined") {
@ -17,8 +32,7 @@ export class AccessToken {
}
get payload() {
const payload = jose.decodeJwt(this.token);
return accessTokenPayloadSchema.validateSync(payload);
return decodeAccessTokenIfValid(this.token) ?? throwErr("Invalid access token in payload (should've been validated in createIfValid)", { token: this.token });
}
get expiresAt(): Date {
@ -87,7 +101,7 @@ export class InternalSession {
refreshToken: string | null,
accessToken?: string | null,
}) {
this._accessToken = new Store(_options.accessToken ? new AccessToken(_options.accessToken) : null);
this._accessToken = new Store(_options.accessToken ? AccessToken.createIfValid(_options.accessToken) : null);
this._refreshToken = _options.refreshToken ? new RefreshToken(_options.refreshToken) : null;
if (_options.accessToken === null && _options.refreshToken === null) {
// this session is already invalid

View File

@ -1,5 +1,19 @@
# @stackframe/stack-ui
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
## 2.8.40
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
## 2.8.39
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@stackframe/stack-ui",
"version": "2.8.39",
"version": "2.8.41",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"sideEffects": false,

View File

@ -1,7 +1,7 @@
{
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY",
"name": "@stackframe/stack",
"version": "2.8.39",
"version": "2.8.41",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@ -1,5 +1,24 @@
# @stackframe/stack
## 2.8.41
### Patch Changes
- Updated dependencies
- @stackframe/stack-shared@2.8.41
- @stackframe/stack-ui@2.8.41
- @stackframe/stack-sc@2.8.41
## 2.8.40
### Patch Changes
- Various changes
- Updated dependencies
- @stackframe/stack-shared@2.8.40
- @stackframe/stack-ui@2.8.40
- @stackframe/stack-sc@2.8.40
## 2.8.39
### Patch Changes

View File

@ -11,7 +11,7 @@
"//": "NEXT_LINE_PLATFORM template",
"private": true,
"version": "2.8.39",
"version": "2.8.41",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@ -2,7 +2,7 @@
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY",
"name": "@stackframe/template",
"private": true,
"version": "2.8.39",
"version": "2.8.41",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",