@cloudbase/auth 2.0.0-alpha.0 → 2.0.0-alpha.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/package.json +4 -4
- package/src/index.ts +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/auth",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "cloudbase javascript sdk auth componets",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cloudbase/oauth": "^1.0.0-alpha.
|
|
30
|
+
"@cloudbase/oauth": "^1.0.0-alpha.1",
|
|
31
31
|
"@cloudbase/types": "^2.0.0-alpha.0",
|
|
32
|
-
"@cloudbase/utilities": "^2.0.0-alpha.
|
|
32
|
+
"@cloudbase/utilities": "^2.0.0-alpha.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "^2.30.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"eslint --fix"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "0e1adf418b1aa2f48569bcc61f493b8c3f600b2b"
|
|
54
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -132,9 +132,9 @@ class User implements IUser {
|
|
|
132
132
|
`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${COMMUNITY_SITE_URL}`
|
|
133
133
|
]
|
|
134
134
|
})
|
|
135
|
-
public async update(userInfo:
|
|
136
|
-
const { name, gender, avatarUrl, province, country, city } = userInfo;
|
|
137
|
-
const newUserInfo = await this._oauthInstance.authApi.setUserProfile({
|
|
135
|
+
public async update(userInfo: authModels.UserProfile): Promise<void> {
|
|
136
|
+
// const { name, gender, avatarUrl, province, country, city } = userInfo;
|
|
137
|
+
const newUserInfo = await this._oauthInstance.authApi.setUserProfile({ ...userInfo })
|
|
138
138
|
|
|
139
139
|
this._setLocalUserInfo(newUserInfo);
|
|
140
140
|
}
|
|
@@ -701,6 +701,10 @@ class Auth {
|
|
|
701
701
|
return this._oauthInstance.authApi.sudo(params)
|
|
702
702
|
}
|
|
703
703
|
|
|
704
|
+
public async loginScope(): Promise<string> {
|
|
705
|
+
return this._oauthInstance.authApi.loginScope()
|
|
706
|
+
}
|
|
707
|
+
|
|
704
708
|
public async onLoginStateChanged(callback: Function) {
|
|
705
709
|
eventBus.on(EVENTS.LOGIN_STATE_CHANGED, async () => {
|
|
706
710
|
const loginState = await this.getLoginState();
|