Removed nested ternaries
This commit is contained in:
parent
3b12961e2e
commit
aad2badb2f
1 changed files with 6 additions and 5 deletions
|
|
@ -84,16 +84,17 @@ export function clientRegistrationHandler({
|
|||
: undefined;
|
||||
const clientIdIssuedAt = Math.floor(Date.now() / 1000);
|
||||
|
||||
// Calculate client secret expiry time
|
||||
const clientsDoExpire = clientSecretExpirySeconds > 0
|
||||
const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0
|
||||
const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime
|
||||
|
||||
let clientInfo: OAuthClientInformationFull = {
|
||||
...clientMetadata,
|
||||
client_id: clientId,
|
||||
client_secret: clientSecret,
|
||||
client_id_issued_at: clientIdIssuedAt,
|
||||
client_secret_expires_at: isPublicClient
|
||||
? clientSecretExpirySeconds > 0
|
||||
? clientIdIssuedAt + clientSecretExpirySeconds
|
||||
: 0
|
||||
: undefined,
|
||||
client_secret_expires_at: clientSecretExpiresAt,
|
||||
};
|
||||
|
||||
clientInfo = await clientsStore.registerClient!(clientInfo);
|
||||
|
|
|
|||
Loading…
Reference in a new issue