Skip to content

Commit 7fa4738

Browse files
committed
fix: making session persist even when wallet is disabled
1 parent 061e05f commit 7fa4738

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/kit.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,16 @@ export class SessionKit {
505505
// Call the `afterLogin` hooks that were registered by the LoginPlugins
506506
for (const hook of context.hooks.afterLogin) await hook(context)
507507

508+
509+
// Offer session key setup if configured and session does not have one yet
510+
if (this.sessionKeyManager && !session.hasSessionKey()) {
511+
try {
512+
await session.setupSessionKey()
513+
} catch (e) {
514+
// User cancelled or setup failed - continue with regular session
515+
// This is not a fatal error, the session is still valid
516+
}
517+
}
508518
// Save the session to storage if it has a storage instance.
509519
this.persistSession(session, options?.setAsDefault)
510520

0 commit comments

Comments
 (0)