backend-common: leave ConfigReader to throw errors when config is missing in ServerTokenManager

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-11-23 13:54:04 +00:00
parent 03962638a0
commit ef9dfd3440
@@ -26,10 +26,8 @@ export class ServerTokenManager implements TokenManager {
}
static fromConfig(config: Config) {
const secret = config.getOptionalString('backend.authorization.secret');
if (!secret) {
throw new Error('No backend auth secret set in app-config');
}
const secret = config.getString('backend.authorization.secret');
return new ServerTokenManager(secret);
}