aboutsummaryrefslogtreecommitdiff
path: root/vnext/server
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server')
-rw-r--r--vnext/server/hms.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/vnext/server/hms.js b/vnext/server/hms.js
index 14f69236..4945fe2a 100644
--- a/vnext/server/hms.js
+++ b/vnext/server/hms.js
@@ -13,9 +13,7 @@ const refreshToken = async () => {
params.append('client_secret', client_secret)
const res = await axios.post('https://oauth-login.cloud.huawei.com/oauth2/v3/token', params).catch(console.log)
try {
- log(`HMS response: ${JSON.stringify(res.data)}`)
const access = res.data
- log(`HMS access token: ${access.access_token}`)
return access.access_token
} catch (error) {
log(error)
@@ -27,8 +25,7 @@ const refreshToken = async () => {
export const send = async (msg, tokenList = []) => {
const adminToken = await refreshToken()
- console.log(`admin token: ${adminToken}, tokenlist: ${tokenList}`)
- if (adminToken) {
+ if (adminToken && tokenList.length > 0) {
const payload = {
'message': msg
}