Commit Graph

14 Commits

Author SHA1 Message Date
Konsti Wohlwend
5bfe1a79ce
New { type: "hosted" } for page URLs (#1261)
Other minor redirect URL changes:

- app.urls.* is now deprecated
- redirectToSignOut now sets and preserves after_auth_return_to
- OAuth sign-in after_auth_return_to now carries callback-return context

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **High Risk**
> High risk because it changes OAuth authorization/token issuance,
redirect URL validation, and introduces a new cross-domain handoff
endpoint plus a DB migration linking authorization codes to refresh
tokens, which can affect login/session security and reliability.
> 
> **Overview**
> Adds **hosted URL targets** for SDK `urls` resolution (new `{ type:
"hosted" }`/`{ type: "handler-component" }`/`{ type: "custom" }`
options), including env-driven hosted handler domain/template support
and fallback routing for unknown `/handler/*` paths.
> 
> Implements a **cross-domain OAuth PKCE handoff**: a new
`/auth/oauth/cross-domain/authorize` endpoint issues one-time
authorization-code redirects bound to the caller’s session refresh
token; authorization codes now persist `grantedRefreshTokenId` and token
issuance reuses/validates ownership of that refresh token. Redirect
planning for `redirectTo*` (and OAuth callback handling) is refactored
into `redirect-page-urls.ts` to preserve `after_auth_return_to` and
cross-domain handoff params.
> 
> Tightens redirect safety (e.g., `after_callback_redirect_url` is
validated/whitelisted), centralizes SDK env var reads via `envVars` with
lint enforcement, hardens `EventTracker` startup for partial DOM test
environments, and adds unit/E2E coverage plus a demo page for manual
cross-domain verification.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9197d4f32b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Cross-domain OAuth PKCE handoff flow (client + server) for hosted
sign-in.
* Hosted handler URL templating with local development domain suffix
support.
* Demo UI page to exercise hosted cross-domain sign-in/out and OAuth
flows.
* Authorization codes now preserve an associated refresh-token id to
support cross-domain exchanges.

* **Bug Fixes**
* Stricter redirect-URL validation and stronger refresh-token ownership
checks.
* More robust event-tracker startup guards in partial DOM environments.

* **Tests**
* New E2E and unit tests covering cross-domain authorize, callback
validation, and handoff flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-27 14:48:01 -07:00
Konstantin Wohlwend
d0b49aa124 Fix lint
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-08-12 18:50:53 -07:00
Zai Shi
d6f3be5543
swithcer (#715)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Enhance `SelectedTeamSwitcher` to support nullable teams and add
'personal' team icon in `TeamIcon`, with updated translations.
> 
>   - **Behavior**:
> - `SelectedTeamSwitcher` in `selected-team-switcher.tsx` now supports
nullable teams with `allowNull` prop and `nullLabel` for display.
> - `onChange` callback added to `SelectedTeamSwitcher` to handle team
changes.
> - `TeamIcon` in `team-icon.tsx` now supports a 'personal' team type,
displaying a default icon.
>   - **Translations**:
> - Added translation key for "Personal team" in
`quetzal-translations.ts`.
>   - **Misc**:
> - Updated `SelectedTeamSwitcherProps` type to handle nullable teams
and added `onChange` callback.
> - Minor refactoring in `selected-team-switcher.tsx` for better
handling of team selection logic.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for ddb61e962b. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-07-02 19:23:53 +02:00
Zai Shi
da1b95ec3b
React SDK (#462) 2025-02-27 01:55:45 +01:00
Konstantin Wohlwend
4199f929bf object-curly-spacing rule 2024-12-23 19:37:05 -08:00
Konsti Wohlwend
c2bc80bda5
Support create-next-app@15 with the setup wizard (#340) 2024-11-13 13:58:42 +01:00
Konsti Wohlwend
057dac1a66
Next.js 15 support (#315)
Some checks failed
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Updates `examples/demo` to Next.js 15 and adds Next.js 15 support to `packages/stack`.

The other packages and apps are still running on Next.js 14 to ensure compatibility.
2024-11-08 03:12:31 +01:00
Zai Shi
92f7b60ec6
Added loading skeleton to components (#328)
* added sign-in skeleton

* added team switcher skeleton

* improved style
2024-11-02 01:44:52 +01:00
Zai Shi
2f761c6467
SDK classes/hooks reference docs (#301)
Split up SDK reference and component reference
Added User and StackApp reference
Fixed stackServerApp.createUser function options
2024-10-20 23:56:43 +02:00
Zai Shi
e9a9bef7e7
SDK docs (#300)
* trigger changes

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/stack-handler.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/selected-team-switcher.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/credential-sign-in.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/use-user.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/credential-sign-up.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/sign-in.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/sign-up.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/password-reset.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/account-settings.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/use-stack-app.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/user-button.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/auth-page.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/message-card.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/magic-link-sign-in.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/stack-provider.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/oauth-button-group.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/oauth-button.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/email-verification.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/forgot-password.mdx

* Patched /tmp/tmp_r_s8ha0/docs/fern/docs/pages/sdk/stack-theme.mdx

* Patched /tmp/tmp3hhqor8i/docs/fern/docs/pages/sdk/stack-handler.mdx

* improved docs

* updated docs

* improved docs

* added credential sign in component image

* updated docs

* updated docs

* updated docs

* updated docs

* improved docs

* improved docs

* added user-button image

* improved docs

---------

Co-authored-by: patched.codes[bot] <298395+patched.codes[bot]@users.noreply.github.com>
2024-10-15 20:11:44 +02:00
Konstantin Wohlwend
9da481b2cd Require newline at the end of each file 2024-10-13 13:06:38 -07:00
Zai Shi
06fcca6fe6
OTP (#263)
* fixed otp send email template

* added version

* added send response type

* updated email template

* added otp email

* added otp page

* fixed bugs

* fixed bugs, added back button on otp page

* otp works

* added max attempts per nonce code

* fixed error return type

* fixed tests

* fixed bugs

* updated button text

* added tests

* added totp code error handling

* removed console.log

* fixed verification code length

* fixed code length

* moved otp inside magic link sign in component

* changed version back, updated ui wording

* added old version otp email tests

* fixed tests
2024-09-24 20:02:06 +02:00
Stan Wohlwend
580bd73348 Fix trailing space lint errors 2024-07-14 10:37:34 -07:00
Zai Shi
934eb78004
Fixed team selection (#124)
* fixed selected team switcher

* fixed selected team switcher

* updated lock files
2024-07-02 02:39:50 +02:00