hivesigner 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,11 +68,12 @@ client.login(params);
68
68
  ### Get login URL for OAuth 2
69
69
  The following method returns a URL that you can redirect the user to so that they may log in to your app through HiveSigner:
70
70
  ```
71
- var link = client.getLoginURL(state);
72
- // => https://hivesigner.com/oauth2/authorize?client_id=[app]&redirect_uri=[callbackURL]&scope=vote,comment&state=[state]
71
+ var link = client.getLoginURL(state, select_account);
72
+ // => https://hivesigner.com/oauth2/authorize?client_id=[app]&redirect_uri=[callbackURL]&scope=vote,comment&state=[state]&select_account=[select_account]
73
73
  ```
74
74
  Parameters:
75
75
  - __state__: Data that will be passed to the callbackURL for your app after the user has logged in.
76
+ - __select_account__: Optional, username selection/detection from Hivesigner UI, if username already imported
76
77
 
77
78
  After logging in, HiveSigner will redirect the user to the "redirect_uri" specified in the login url above and add the following query string parameters for your app to use:
78
79
  - __access_token__: This is the oauth2 access token that is required to make any Hive API calls on behalf of the current user. Once you have this you need to tell the HiveSigner.js to use it by either specifying it as a parameter to the init() method call or by calling sc2.setAccessToken([accessToken]).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hivesigner",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Hivesigner SDK",
5
5
  "main": "./lib/index",
6
6
  "types": "./lib/index",
@@ -83,6 +83,9 @@ describe('Client', function () {
83
83
 
84
84
  expect(instance.getLoginURL('state'))
85
85
  .toBe(`${BASE_URL}/oauth2/authorize?client_id=test-app&redirect_uri=${encodeURIComponent(instance.callbackURL)}&response_type=code&scope=test-scope,test-scope-1&state=state`)
86
+
87
+ expect(instance.getLoginURL('state', 'demo'))
88
+ .toBe(`${BASE_URL}/oauth2/authorize?client_id=test-app&redirect_uri=${encodeURIComponent(instance.callbackURL)}&response_type=code&scope=test-scope,test-scope-1&state=state&account=demo`)
86
89
  })
87
90
 
88
91
  it('should change window location on login if its browser', function () {