UNPKG

@sap-cloud-sdk/connectivity

Version:

SAP Cloud SDK for JavaScript connectivity

17 lines 762 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shouldExchangeToken = shouldExchangeToken; const jwt_1 = require("./jwt"); /** * @internal * Checks whether the IAS token to XSUAA token exchange should be applied. * @param options - Configuration for how to retrieve destinations from the destination service. * @returns A boolean value, that indicates whether the token exchange should be applied. */ function shouldExchangeToken(options) { // iasToXsuaaTokenExchange is optional, token exchange is disabled by default return (options.iasToXsuaaTokenExchange === true && !!options.jwt && !(0, jwt_1.isXsuaaToken)((0, jwt_1.decodeJwt)(options.jwt))); } //# sourceMappingURL=identity-service.js.map