Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@henrybuilt/react-app

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@henrybuilt/react-app - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

src/components/page/page.test.js

15

package.json
{
"name": "@henrybuilt/react-app",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "react-scripts test --watchAll"
},

@@ -19,3 +19,14 @@ "author": "",

"redux": "^4.0.4"
},
"devDependencies": {
"npm": "^6.13.4",
"lodash": "^4.17.15",
"react-scripts": "^3.3.0",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"henrybuilt-react-library": "^1.0.22",
"react-router-dom": "^5.1.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2"
}
}

24

src/components/page/page.js
import {React, className, Component} from 'henrybuilt-react-library';
import {Redirect} from 'react-router-dom';
import _ from 'lodash';

@@ -8,8 +9,5 @@ class Page extends Component {

render(content) {
var {isLoggedIn} = this.props.session;
var hasPermission = this.authGroup === 'anyone' ? true : isLoggedIn;
if (!this.hasPermission) window.location = `${this.accountsDomain}/login`;
if (!hasPermission) window.location = `${this.accountsDomain}/login`;
return hasPermission ? (
return this.hasPermission ? (
<div {...className([`page ${_.kebabCase(this.key)}-page`, this.className])}>

@@ -21,2 +19,18 @@ {content}

get hasPermission() {
var authGroupNumberMap = {
anyone: 10,
user: 20,
employee: 30,
admin: 40
};
var authGroupNumbers = {
page: authGroupNumberMap[this.authGroup] || 1000,
user: authGroupNumberMap[_.get(this.props.session.user, 'authGroup', 'anyone')] || 10, //if invalid authGroup effectivly anyone
}
return authGroupNumbers.page <= authGroupNumbers.user;
}
get accountsDomain() {

@@ -23,0 +37,0 @@ return process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://henrybuilt.com';

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