diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html
index 081550a03..c50a75442 100644
--- a/docs/generated/changelog.html
+++ b/docs/generated/changelog.html
@@ -13,6 +13,13 @@
Agent-JS Changelog
Version 0.13.4
- chore: auth-client expose storage constant keys
+ -
+ bug: auth-client resolves window.open issue in login function in safari due to async
+ storage call
+
+ -
+ bug: auth-client storage wrapper returns after resolve to avoid idb to be recreated
+
Version 0.13.3
diff --git a/packages/auth-client/src/storage.ts b/packages/auth-client/src/storage.ts
index 8bbfed55c..b713241cc 100644
--- a/packages/auth-client/src/storage.ts
+++ b/packages/auth-client/src/storage.ts
@@ -68,11 +68,14 @@ export class LocalStorage implements AuthClientStorage {
* @see implements {@link AuthClientStorage}
*/
export class IdbStorage implements AuthClientStorage {
- // Intializes a KeyVal on first request
+ // Initializes a KeyVal on first request
private initializedDb: IdbKeyVal | undefined;
get _db(): Promise {
return new Promise(resolve => {
- if (this.initializedDb) resolve(this.initializedDb);
+ if (this.initializedDb) {
+ resolve(this.initializedDb);
+ return;
+ }
IdbKeyVal.create({ version: DB_VERSION }).then(db => {
this.initializedDb = db;
resolve(db);