Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable variable session time for mpcCoreKit #89

Merged
merged 14 commits into from
Apr 9, 2024

Conversation

lwin-kyaw
Copy link
Contributor

  • provide custom session time for SessionToken Data based on the clients' subscribe plans
  • create new test cases for session time

@lwin-kyaw
Copy link
Contributor Author

This PR is depended on the torus.js PR, torusresearch/torus.js#129

To make this variable session time works, we may need the following

Will update the PR again once this, torusresearch/torus.js#129, is merged and published

@lwin-kyaw
Copy link
Contributor Author

Updated torus.js as torus.js@v12.2.0 has been released.

However, to make this variable session time works properly, we still need the following things

  • Update torus.js@v12.20 in CustomAuth. Deps update PR
  • Update @tkey/service-provider-torus with CustomAuth updates

Currently, I've used npm overrides to update the peer dependencies in the package.json to make session time works.

"dependencies": {
...
},
"overrides": {
    "@toruslabs/customauth": {
    "@toruslabs/http-helpers": "^6.0.0",
    "@toruslabs/torus.js": "12.2.0"
  },
    "@tkey-mpc/service-provider-torus": {
    "@toruslabs/torus.js": "12.2.0"
  }
},

@lwin-kyaw lwin-kyaw marked this pull request as ready for review March 13, 2024 19:11
@lwin-kyaw lwin-kyaw requested review from ieow and himanshuchawla009 and removed request for ieow March 13, 2024 19:11
@@ -116,6 +116,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
if (typeof options.manualSync !== "boolean") options.manualSync = false;
if (!options.web3AuthNetwork) options.web3AuthNetwork = WEB3AUTH_NETWORK.MAINNET;
if (!options.sessionTime) options.sessionTime = 86400;
if (!options.serverTimeOffset) options.serverTimeOffset = 0; // ms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to pass this param in torus.js and customAuth constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a PR, torusresearch/CustomAuth#331 to include serverTimeOffset value in respective constructors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, till we merge and release custom auth, can you remove serverTimeOffset param from this sdk

@himanshuchawla009 himanshuchawla009 merged commit 99e0553 into master Apr 9, 2024
1 check passed
@himanshuchawla009 himanshuchawla009 deleted the feat/variable-session-time branch April 9, 2024 06:54
@himanshuchawla009 himanshuchawla009 restored the feat/variable-session-time branch April 17, 2024 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants