Skip to content

Commit f13ebef

Browse files
chore: version packages [skip ci]
1 parent 6eb731a commit f13ebef

4 files changed

Lines changed: 24 additions & 23 deletions

File tree

.changeset/issue-79-idempotent-callback.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bb-auth-oidc/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# @aws-blocks/bb-auth-oidc
22

3+
## 0.1.5
4+
5+
### Patch Changes
6+
7+
- 607fe57: fix(bb-auth-oidc): make `handleRedirectCallback()` idempotent under double invocation
8+
9+
`handleRedirectCallback()` consumed the single-use PKCE pending entry from
10+
`sessionStorage` and only removed it **after** the `/aws-blocks/auth/exchange`
11+
round-trip. A second concurrent invocation — most commonly React StrictMode's
12+
mount → unmount → mount, which fires the callback effect twice synchronously —
13+
either replayed the already-consumed code (failing the second exchange) or
14+
found the pending entry gone and resolved `null`, stranding the app on a
15+
signed-out screen despite a successful sign-in.
16+
17+
The callback now guards on an in-flight promise keyed by the PKCE `code`:
18+
concurrent/duplicate invocations for the same code share the first call's
19+
promise instead of starting a second exchange, so both callers resolve to the
20+
same user and subscribers are notified exactly once. The pending entry is also
21+
consumed up front (before the network round-trip) so a late duplicate can't
22+
replay it, and the guard is released once the exchange settles so a genuinely
23+
new sign-in flow on the same page is never blocked.
24+
325
## 0.1.4
426

527
### Patch Changes

packages/bb-auth-oidc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-blocks/bb-auth-oidc",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"author": "Amazon Web Services",
55
"license": "Apache-2.0",
66
"type": "module",

0 commit comments

Comments
 (0)