parse-dashboard 8.0.0 → 8.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,13 @@ module.exports = (options) => {
162
162
  if (allowInsecureHTTP || trustProxy || dev) {app.enable('trust proxy');}
163
163
 
164
164
  config.data.trustProxy = trustProxy;
165
- const dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev, cookieSessionMaxAge };
165
+ const dashboardOptions = {
166
+ allowInsecureHTTP,
167
+ cookieSessionSecret,
168
+ dev,
169
+ cookieSessionMaxAge,
170
+ cookieSessionStore: config.data.cookieSessionStore
171
+ };
166
172
  app.use(mountPath, parseDashboard(config.data, dashboardOptions));
167
173
  let server;
168
174
  if(!configSSLKey || !configSSLCert){
package/README.md CHANGED
@@ -803,6 +803,55 @@ If you create a new user by running `parse-dashboard --createUser`, you will be
803
803
 
804
804
  Parse Dashboard follows the industry standard and supports the common OTP algorithm `SHA-1` by default, to be compatible with most authenticator apps. If you have specific security requirements regarding TOTP characteristics (algorithm, digit length, time period) you can customize them by using the guided configuration mentioned above.
805
805
 
806
+ ### Running Multiple Dashboard Replicas
807
+
808
+ When deploying Parse Dashboard with multiple replicas behind a load balancer, you need to use a shared session store to ensure that CSRF tokens and user sessions work correctly across all replicas. Without a shared session store, login attempts may fail with "CSRF token validation failed" errors when requests are distributed across different replicas.
809
+
810
+ #### Using a Custom Session Store
811
+
812
+ Parse Dashboard supports using any session store compatible with [express-session](https://github.com/expressjs/session). The `sessionStore` option must be configured programmatically when initializing the dashboard.
813
+
814
+ **Suggested Session Stores:**
815
+
816
+ - [connect-redis](https://www.npmjs.com/package/connect-redis) - Redis session store
817
+ - [connect-mongo](https://www.npmjs.com/package/connect-mongo) - MongoDB session store
818
+ - [connect-pg-simple](https://www.npmjs.com/package/connect-pg-simple) - PostgreSQL session store
819
+ - [memorystore](https://www.npmjs.com/package/memorystore) - Memory session store with TTL support
820
+
821
+ **Example using connect-redis:**
822
+
823
+ ```js
824
+ const express = require('express');
825
+ const ParseDashboard = require('parse-dashboard');
826
+ const { createClient } = require('redis');
827
+ const RedisStore = require('connect-redis').default;
828
+
829
+ // Instantiate Redis client
830
+ const redisClient = createClient({ url: 'redis://localhost:6379' });
831
+ redisClient.connect();
832
+
833
+ // Instantiate Redis session store
834
+ const cookieSessionStore = new RedisStore({ client: redisClient });
835
+
836
+ // Configure dashboard with session store
837
+ const dashboard = new ParseDashboard({
838
+ apps: [...],
839
+ users: [...],
840
+ }, {
841
+ cookieSessionStore,
842
+ cookieSessionSecret: 'your-secret-key',
843
+ });
844
+
845
+ **Important Notes:**
846
+
847
+ - The `cookieSessionSecret` option must be set to the same value across all replicas to ensure session cookies work correctly.
848
+ - If `cookieSessionStore` is not provided, Parse Dashboard will use the default in-memory session store, which only works for single-instance deployments.
849
+ - For production deployments with multiple replicas, always configure a shared session store.
850
+
851
+ #### Alternative: Using Sticky Sessions
852
+
853
+ If you cannot use a shared session store, you can configure your load balancer to use sticky sessions (session affinity), which ensures that requests from the same user are always routed to the same replica. However, using a shared session store is the recommended approach as it provides better reliability and scalability.
854
+
806
855
  ### Separating App Access Based on User Identity
807
856
  If you have configured your dashboard to manage multiple applications, you can restrict the management of apps based on user identity.
808
857
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse-dashboard",
3
- "version": "8.0.0",
3
+ "version": "8.1.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/parse-community/parse-dashboard"