@cloudbase/auth 2.0.1-alpha.2 → 2.4.0-alpha.0
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/package.json +3 -3
- package/src/index.ts +14 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/auth",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.4.0-alpha.0",
|
|
4
4
|
"description": "cloudbase javascript sdk auth componets",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cloudbase/oauth": "^2.
|
|
30
|
+
"@cloudbase/oauth": "^2.4.0-alpha.0",
|
|
31
31
|
"@cloudbase/types": "^2.0.0-alpha.2",
|
|
32
32
|
"@cloudbase/utilities": "^2.0.0-alpha.4"
|
|
33
33
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"eslint --fix"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "060aa0783ef4e68ffc49db6fb7944559d1b10106"
|
|
54
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -611,8 +611,16 @@ class Auth {
|
|
|
611
611
|
public async getUserInfo(): Promise<IUserInfo> {
|
|
612
612
|
return this._oauthInstance.authApi.getUserInfo()
|
|
613
613
|
}
|
|
614
|
-
|
|
615
|
-
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* getAuthHeader 兼容处理
|
|
617
|
+
* 返回空对象
|
|
618
|
+
*/
|
|
619
|
+
public getAuthHeader(): {} {
|
|
620
|
+
console.error('Auth.getAuthHeader API 已废弃')
|
|
621
|
+
return {}
|
|
622
|
+
}
|
|
623
|
+
|
|
616
624
|
/**
|
|
617
625
|
* 为已有账户绑第三方账户
|
|
618
626
|
* @param {authModels.BindWithProviderRequest} params
|
|
@@ -702,6 +710,10 @@ class Auth {
|
|
|
702
710
|
return this._oauthInstance.authApi.loginScope()
|
|
703
711
|
}
|
|
704
712
|
|
|
713
|
+
public async loginGroups(): Promise<string[]> {
|
|
714
|
+
return this._oauthInstance.authApi.loginGroups()
|
|
715
|
+
}
|
|
716
|
+
|
|
705
717
|
public async onLoginStateChanged(callback: Function) {
|
|
706
718
|
eventBus.on(EVENTS.LOGIN_STATE_CHANGED, async () => {
|
|
707
719
|
const loginState = await this.getLoginState();
|