Skip to content

Commit 9d5bbdb

Browse files
chore(token): fallback for accessing the token
1 parent 389e2e8 commit 9d5bbdb

File tree

3 files changed

+125
-95
lines changed

3 files changed

+125
-95
lines changed

examples/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ app.use('/api/speech-to-text/token', function(req, res) {
102102
res.status(500).send('Error retrieving token');
103103
return;
104104
}
105-
res.send(token.token);
105+
res.send(token.token || token);
106106
});
107107
});
108108

@@ -125,7 +125,7 @@ app.use('/api/text-to-speech/token', function(req, res) {
125125
res.status(500).send('Error retrieving token');
126126
return;
127127
}
128-
res.send(token.token);
128+
res.send(token.token || token);
129129
});
130130
});
131131

0 commit comments

Comments
 (0)