Skip to content

Commit 8c655e7

Browse files
author
dfounderliu
committed
fix login
1 parent 1fdbb57 commit 8c655e7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "serverless-tencent-scf",
3-
"version": "0.1.15",
2+
"name": "serverless-tencent-scf-beta",
3+
"version": "0.1.16",
44
"description": "Provider plugin for the Serverless Framework v1.x which adds support for Tencent Cloud Functions.",
55
"main": "index.js",
6-
"author": "serverless.com",
6+
"author": "Tencent Cloud, Inc.",
77
"license": "MIT",
88
"repository": {
99
"git": "https://github.com/serverless-tencent/serverless-tencent-scf"
@@ -43,7 +43,7 @@
4343
"request": "^2.88.0",
4444
"tencentcloud-sdk-nodejs": "^3.0.87",
4545
"universal-analytics": "^0.4.20",
46-
"tencent-login": "^0.1.2"
46+
"tencent-login": "^0.1.6"
4747
},
4848
"devDependencies": {
4949
"coveralls": "^3.0.5",

provider/tencentProvider.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ class TencentProvider {
138138
timestamp: tencent_credentials.timestamp
139139
}
140140
await fs.writeFileSync('./.env_temp', JSON.stringify(tencent))
141-
this.context.debug(
142-
'The temporary key is saved successfully, and the validity period is two hours.'
143-
)
144141
return tencent
145142
} catch (e) {
146143
throw 'Error getting temporary key: ' + e
@@ -155,7 +152,10 @@ class TencentProvider {
155152
try {
156153
const tencent = {}
157154
const tencent_credentials_read = JSON.parse(data)
158-
if (Date.now() / 1000 - tencent_credentials_read.timestamp <= 6000) {
155+
if (
156+
Date.now() / 1000 - tencent_credentials_read.timestamp <= 6000 &&
157+
tencent_credentials_read.tencent_appid
158+
) {
159159
return tencent_credentials_read
160160
}
161161
const login = new TencentLogin()

0 commit comments

Comments
 (0)