mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
* SSO 🔥 (#2) * Add rough implementation of google SSO * Use env variables for storing Google Oauth client id * Set organization user to active when a new user is created via sso This commit also fetches first name and last name from the payload received from google. Also adds some refactoring. * Apply proper styles to google login button * Refactor oauth controller * Move google specific logic to a separate service * Fail sign-in if google could not verify idToken * Refactoring update for GoogleOAuthService * Change env variable name for google sso client id * Show Google sign-in button only if client id env variable is given * Add SSO_GOOGLE_OAUTH2_CLIENT_ID to app.json * Whitelist apis.google.com in CSP * Add accounts.google.com to CSP * Add documentation for Google SSO * Add e2e tests for Google SSO * Resolve minor linting issues * Avoid use of raw query in migration for SSO ID This commit also adds an index for SSO ID * Verify domain of user's email id for single sign on * Add documentation for RESTRICTED_DOMAIN env variable in SSO * Move SSO controllers and services to ee folder * Move GoogleLoginButton to ee folder * Test the restricted domain verification for Google SSO * Remove unnecessary console.log * Apply better styles to Sign in with google button * Remove documentation for Google SSO This will be added to the community edition repo * Remove unnecessary static images * Fetch Google OAuth2 client id from server instead of client env (#3) * Check for existing email when signing in via SSO (#4) * hotfix oauth service return type * hotfix sso user creation * Allow disabling sign-up via SSO (#5) * hotfix file input change on import/export * Align SSO button on login box center (#6) * Fix: group permission not being set on sso (#7) * fixes group permission not being set on sso * update specs for sso * lint fix * add user id on login response * decamelize keys on login response * fix specs Co-authored-by: Akshay Sasidharan <[email protected]> Co-authored-by: navaneeth <[email protected]>
103 lines
2.3 KiB
JavaScript
103 lines
2.3 KiB
JavaScript
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const webpack = require('webpack');
|
|
const path = require('path');
|
|
|
|
const environment = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
|
|
|
const API_URL = {
|
|
production: process.env.TOOLJET_SERVER_URL || '',
|
|
development: 'http://localhost:3000',
|
|
};
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
target: 'web',
|
|
resolve: {
|
|
extensions: ['.js', '.jsx', '.png'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src/'),
|
|
'@ee': path.resolve(__dirname, 'ee/'),
|
|
},
|
|
},
|
|
...(environment === 'development' && { devtool: 'inline-source-map' }),
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ttf$/,
|
|
use: ['file-loader'],
|
|
},
|
|
{
|
|
test: /\.svg$/,
|
|
use: [
|
|
{
|
|
loader: '@svgr/webpack',
|
|
options: {
|
|
limit: 10000,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
{
|
|
loader: 'style-loader',
|
|
},
|
|
{
|
|
loader: 'css-loader',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
{
|
|
loader: 'style-loader',
|
|
},
|
|
{
|
|
loader: 'css-loader',
|
|
},
|
|
{
|
|
loader: 'sass-loader',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /node_modules/,
|
|
resolve: {
|
|
extensions: ['.js', '.jsx'],
|
|
},
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
plugins: [
|
|
['import', { libraryName: 'lodash', libraryDirectory: '', camel2DashComponentName: false }, 'lodash'],
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/index.html',
|
|
}),
|
|
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /(en)$/),
|
|
],
|
|
devServer: {
|
|
historyApiFallback: true,
|
|
},
|
|
output: {
|
|
publicPath: process.env.ASSET_PATH || '/',
|
|
path: path.resolve(__dirname, 'build'),
|
|
},
|
|
externals: {
|
|
// global app config object
|
|
config: JSON.stringify({
|
|
apiUrl: `${API_URL[environment] || ''}/api`,
|
|
SERVER_IP: process.env.SERVER_IP,
|
|
COMMENT_FEATURE_ENABLE: true,
|
|
}),
|
|
},
|
|
};
|