@seamless-auth/react 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @seamless-auth/react
2
2
 
3
+ ## 0.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 15ed347: The SMS terms modal now lists `support@fellscode.com` as the opt-out and support contact.
8
+ - f21867d: OAuth sign-in now carries the state binding the auth server returns from `POST /oauth/:providerId/start` back to the callback. The session actions `startOAuthLogin` and `finishOAuthLogin` (and so `useAuth()` in React and React Native, and the Angular, Vue and Svelte bindings) store the binding with its state, attach it to the matching callback, and clear it afterwards, so apps that call these actions directly need no code change. The binding is kept in `sessionStorage` under `seamless:oauth:binding` in a browser and in memory elsewhere, and is never sent to the provider or put in a URL. `startOAuthSignIn` passes it explicitly when an in-app browser hands the callback back, and now refuses a callback whose state is not the one it started.
9
+
10
+ `StartOAuthLoginResult` gains an optional `binding` and `FinishOAuthLoginInput` an optional `binding`. Older auth servers return no binding and are unaffected. Auth API 0.19.x with fells-code/seamless-auth-api#463 refuses a callback without the binding, so upgrade this SDK before or with that API release.
11
+
12
+ - Updated dependencies [f21867d]
13
+ - @seamless-auth/client@0.7.1
14
+
3
15
  ## 0.18.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -574,6 +574,14 @@ function OAuthCallback() {
574
574
  }
575
575
  ```
576
576
 
577
+ Auth servers that bind the OAuth state to the client that started sign-in (API 0.19.x with
578
+ fells-code/seamless-auth-api#463) return a `binding` from `startOAuthLogin` and refuse a callback
579
+ without it (`400`, `Invalid OAuth state`). The `useAuth()` actions handle this for you:
580
+ `startOAuthLogin` keeps the binding in `sessionStorage` under `seamless:oauth:binding`, keyed to its
581
+ `state`, and `finishOAuthLogin` sends it with the matching callback and then clears it. Only pass
582
+ `binding` yourself if you start and finish on different `useAuth()` instances or with the headless
583
+ client, and keep it out of URLs: it goes to your auth server, never to the provider.
584
+
577
585
  Some callback failures are the user's to fix, so the API returns a stable `code` alongside the error
578
586
  message. `getOAuthErrorCode()` narrows it to the codes this SDK knows about and returns `undefined`
579
587
  for everything else, so unexpected failures keep your generic message:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamless-auth/react",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "A drop-in authentication solution for modern React applications.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,8 +56,8 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "@seamless-auth/client": "^0.7.0",
60
- "@seamless-auth/types": "^0.28.0",
59
+ "@seamless-auth/client": "^0.7.1",
60
+ "@seamless-auth/types": "^0.29.0",
61
61
  "@simplewebauthn/browser": "^13.1.0",
62
62
  "libphonenumber-js": "^1.12.7"
63
63
  },