Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function OrganizationSamlStrategy(config: Config) {
return new MultiSamlStrategy(
{
path: `${config.urlPrefix}/login/saml/callback`,
getSamlOptions: async (req, done) => {
try {
const host = req.get('host');
const organization = await req.organization();
const configuration = {
callbackUrl: `https://${host}${
config.urlPrefix
}/login/saml/callback?to=${req.query.to || '/'}`,
cert: organization.ssoCert,
entryPoint: organization.ssoEntrypoint,
issuer: organization.ssoIssuer,
};
return done(null, configuration);
} catch (err) {
export default function OrganizationSamlStrategy(config: Config) {
return new MultiSamlStrategy(
{
path: `${config.urlPrefix}/login/saml/callback`,
getSamlOptions: async (req, done) => {
try {
const host = req.get('host');
const organization = await req.organization();
const configuration = {
callbackUrl: `https://${host}${
config.urlPrefix
}/login/saml/callback?to=${req.query.to || '/'}`,
cert: organization.ssoCert,
entryPoint: organization.ssoEntrypoint,
issuer: organization.ssoIssuer,
};
return done(null, configuration);
} catch (err) {