mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 14:14:17 +00:00
small strict improvements (#1428)
* small `strict` improvements * fix type * use isObject
This commit is contained in:
committed by
GitHub
parent
743d7fa782
commit
cd913fc144
@@ -74,10 +74,11 @@ export function revoke(): ReturnType<typeof hasAuth> {
|
||||
*/
|
||||
export function handleClientSecret(clientSecret: string): ClientSecret {
|
||||
const clientSecretObject = JSON.parse(clientSecret);
|
||||
const isValid = validateClientSecret(clientSecretObject);
|
||||
|
||||
if (!isValid) {
|
||||
throw new Error('Client secret invalid');
|
||||
try {
|
||||
validateClientSecret(clientSecretObject);
|
||||
} catch (error) {
|
||||
throw new Error(`Client secret is invalid: ${error}`);
|
||||
}
|
||||
|
||||
return clientSecretObject;
|
||||
|
||||
Reference in New Issue
Block a user