Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .changeset/quiet-otters-return.md

This file was deleted.

29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @seamless-auth/types

## 0.20.0

### Minor Changes

- 9541d01: Carry `returnTo` back out of the OAuth callback, and hold it to a scheme that can be a
link destination.

`StartOAuthLoginRequestSchema` has taken a `returnTo` since OAuth landed, and nothing ever
gave it back. `seamless-auth-api` validated it against the configured origins and signed it
into the state, and `seamless-auth-react` sent it, but no schema carried it to the end of the
flow, so a client that asked to be returned somewhere had no way to learn where. It was a
field that looked supported and did nothing.

`OAuthLoginSuccessResponseSchema` now carries an optional `returnTo`. The API reads it back
out of the signed state rather than from the callback request, so it is the value validated
at `/start` and not one introduced at the end of the round trip. Absent when the caller asked
for nothing, so a client falls through to its own default rather than treating absence as an
error.

Both `returnTo` fields move from `z.url()` to `RedirectTargetSchema`. `z.url()` accepts
`javascript:alert(1)` and `data:text/html,...`, and a client navigates to whatever comes back
out of this flow, so it is the same sink a magic link destination is. That is what
`RedirectTargetSchema` was added for in 0.18.0, and the OAuth fields should have used it
then.

Additive for a consumer that ignores the new field. A caller that was somehow sending a
`javascript:` or `data:` `returnTo` is now refused at the schema rather than later, which is
the intended change.

## 0.19.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seamless-auth/types",
"version": "0.19.0",
"version": "0.20.0",
"description": "Shared TypeScript types and Zod schemas for SeamlessAuth.",
"author": "Fells Code, LLC",
"license": "AGPL-3.0-only",
Expand Down