Skip to content

Session does not persist after browser close (Safari) – “unable to decrypt bundle using embedded key” #1668

@syuhei176

Description

@syuhei176

Environment

  • Browser version: Safari Version 17.6 (19618.3.11.11.5)
  • Mac OS Sonoma 14.6.1
  • AA SDK version: v4.40.0 (v4.0.0 - v4.40.0)
  • Package: @account-kit/signer

Describe the problem

We’re experiencing a critical issue where sessions do not persist across browser restarts when using Alchemy Account Kit on Safari (both desktop and iOS). Upon reopening the browser, the following error occurs:

Failed to load user from session  
Error: unable to decrypt bundle using embedded key. the bundle may be incorrect. failed with error: M: The operation failed for an operation-specific reason

How to reproduce:

1.	Use Safari (desktop or iOS) or Chrome on iOS
2.	Open an app that integrates Alchemy Account Kit and log in using Google, email, or any other supported social login provider.
3.	Close the browser completely (i.e. force quit or fully close the app so that in-memory data is cleared)
4.	Reopen the browser and revisit the app
5.	Session fails to restore, and the error above appears

I initially discovered the issue in my own project, but it also occurs in the following examples:

Relevant code or sample repro:

For reference, I have confirmed that the Turnkey bundle is indeed being passed to injectCredentialBundle. So localStorage is not being cleared.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions