mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-10-09 21:14:00 +00:00
Speech should always be attached to an SP (#98)
* user will always be attached to SP, thus always provide SP sid * add another fallback for service_provider_sid * fix the email and username check in user creation that was crashing the server * not allow same names for shared and account carriers Co-authored-by: eglehelms <e.helms@cognigy.com>
This commit is contained in:
@@ -118,13 +118,13 @@ router.post('/', async(req, res) => {
|
||||
vendor,
|
||||
} = req.body;
|
||||
const account_sid = req.user.account_sid || req.body.account_sid;
|
||||
let service_provider_sid;
|
||||
const service_provider_sid = req.user.service_provider_sid ||
|
||||
req.body.service_provider_sid || parseServiceProviderSid(req);
|
||||
if (!account_sid) {
|
||||
if (!req.user.hasServiceProviderAuth && !req.user.hasAdminAuth) {
|
||||
logger.error('POST /SpeechCredentials invalid credentials');
|
||||
return res.sendStatus(403);
|
||||
}
|
||||
service_provider_sid = parseServiceProviderSid(req);
|
||||
}
|
||||
try {
|
||||
const encrypted_credential = encryptCredential(req.body);
|
||||
|
||||
Reference in New Issue
Block a user