Socket
Socket
Sign inDemoInstall

@ladjs/web

Package Overview
Dependencies
Maintainers
3
Versions
247
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladjs/web - npm Package Compare versions

Comparing version 0.1.1 to 0.1.3

28

index.js

@@ -7,3 +7,2 @@ const http = require('http');

const _ = require('lodash');
const Boom = require('boom');
const Koa = require('koa');

@@ -35,3 +34,2 @@ const Cabin = require('cabin');

const flash = require('koa-better-flash');
const CSRF = require('koa-csrf');
const StoreIPAddress = require('@ladjs/store-ip-address');

@@ -45,2 +43,4 @@ const isajax = require('koa-isajax');

const StateHelper = require('@ladjs/state-helper');
const Boom = require('boom');
const CSRF = require('koa-csrf');

@@ -91,2 +91,15 @@ class Server {

cookiesKey: process.env.COOKIES_KEY || 'lad.sid',
// <https://github.com/pillarjs/cookies#cookiesset-name--value---options-->
// <https://github.com/koajs/generic-session/blob/master/src/session.js#L32-L38>
cookies: {
httpOnly: true,
path: '/',
overwrite: true,
signed: true,
maxAge: 24 * 60 * 60 * 1000,
secure: process.env.WEB_PROTOCOL === 'https',
// we use SameSite cookie support as an alternative to CSRF
// <https://scotthelme.co.uk/csrf-is-dead/>
sameSite: 'lax'
},
livereload: {

@@ -219,3 +232,9 @@ port: process.env.LIVERELOAD_PORT || 35729

app.keys = this.config.sessionKeys;
app.use(session({ store: redisStore, key: this.config.cookiesKey }));
app.use(
session({
store: redisStore,
key: this.config.cookiesKey,
cookie: this.config.cookies
})
);

@@ -244,3 +263,2 @@ // flash messages

// csrf (with added localization support)
app.use((ctx, next) => {

@@ -252,2 +270,4 @@ // TODO: add cookies key until koa-better-error-handler issue is resolved

});
// csrf (with added localization support)
app.use(async (ctx, next) => {

@@ -254,0 +274,0 @@ if (process.env.NODE_ENV === 'test') {

8

package.json
{
"name": "@ladjs/web",
"description": "Web server for Lad",
"version": "0.1.1",
"version": "0.1.3",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

@@ -49,3 +49,3 @@ "bugs": {

"koa-simple-ratelimit": "^2.3.3",
"koa-views": "https://github.com/niftylettuce/koa-views",
"koa-views": "^6.1.3",
"lodash": "^4.17.4",

@@ -62,3 +62,3 @@ "redis": "^2.8.0"

"cross-env": "^5.1.1",
"eslint": "^4.13.0",
"eslint": "^4.13.1",
"eslint-config-prettier": "^2.9.0",

@@ -69,3 +69,3 @@ "eslint-plugin-prettier": "^2.3.1",

"nyc": "^11.3.0",
"prettier": "^1.9.1",
"prettier": "^1.9.2",
"remark-cli": "^4.0.0",

@@ -72,0 +72,0 @@ "remark-preset-github": "^0.0.7",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc