aboutsummaryrefslogtreecommitdiff
path: root/vnext
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2024-03-14 19:10:16 +0300
committerGravatar Vitaly Takmazov2024-03-14 19:10:16 +0300
commit0e1f88d67d1b9c77a854a887da45a10994cf91f3 (patch)
treee51e7159b6568851d2c6a123e33eef0aa20fadb6 /vnext
parent9af545e76ce95a3b5a5be14310530716d1b8060f (diff)
vnext: cleanup HMS
Diffstat (limited to 'vnext')
-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
}