Skip to content

Commit

Permalink
docs: browser session management
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiter committed Jul 28, 2022
1 parent 41bfc12 commit 762a42e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/setup/using_in_browser.md
@@ -0,0 +1,11 @@
[Initialization of library](./intialization.md) requires several properties of [signer](../api/classes/modules_signer.SignerService.md):

- The signer meets [EIP-191: Signed Data Standard](https://eips.ethereum.org/EIPS/eip-191)
- Public key. This is legacy parameter, which was used to initialized DID document

These properties are not directly exposed by all signers, such as Metamask, and thus are determined in runtime by sending test sign request.
In order to improve user expirience when library is used in browser it tries to get these parameters from local storage.
In order to implement application specific session management the library doesn't modify storage and relies on the application to set `isEthSigner` and `PublicKey` local storage variables on login.
For example to disable session application will not set properties.
If properties are not in local storage then signer initialization will be completed on login to ssi-hub.
Initialization is postponed in order to prevent double signing when user is not logged in ssi-hub.
1 change: 1 addition & 0 deletions mkdocs.yml
Expand Up @@ -6,6 +6,7 @@ nav:
- Setup:
- Initialization: setup/initialization.md
- Logging: setup/logging.md
- Using in browser: setup/using_in_browser.md
- Guides:
- Application: guides/application.md
- Asset: guides/asset.md
Expand Down

0 comments on commit 762a42e

Please sign in to comment.