How to use the unleash-server.AuthenticationRequired function in unleash-server

To help you get started, we’ve selected a few unleash-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kindlyops / havengrc / unleash / keycloak-auth-hook.js View on Github external
app.use('/api/admin/', (req, res, next) => {
        if (req.user) {
            next();
        } else {
            // Instruct unleash-frontend to pop-up auth dialog
            return res
                .status('401')
                .json(
                    new AuthenticationRequired({
                        path: '/unleash/api/admin/login',
                        type: 'custom',
                        message: `You have to identify yourself in order to use Unleash. 
                        Click the button and follow the instructions.`,
                    })
                )
                .end();
        }
    });
}
github kindlyops / havengrc / unleash / google-auth-hook.js View on Github external
app.use('/api/admin/', (req, res, next) => {
        if (req.user) {
            next();
        } else {
            // Instruct unleash-frontend to pop-up auth dialog
            return res
                .status('401')
                .json(
                    new AuthenticationRequired({
                        path: '/api/admin/login',
                        type: 'custom',
                        message: `You have to identify yourself in order to use Unleash. 
                        Click the button and follow the instructions.`,
                    })
                )
                .end();
        }
    });
}

unleash-server

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

Apache-2.0
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis