Skip to content

Commit 40dd7d9

Browse files
committed
Add a public property in the apps metadata.
1 parent dae6747 commit 40dd7d9

File tree

12 files changed

+31
-20
lines changed

12 files changed

+31
-20
lines changed

coder-apps/common/auth/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#1abc9c",
55
"author": "Jason Striegel",
66
"name": "Auth",
7-
"hidden": true
8-
}
7+
"hidden": true,
8+
"public": true
9+
}

coder-apps/common/boilerplate/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#3e3e3e",
55
"author": "Jason Striegel",
66
"name": "Boilerplate",
7-
"hidden": true
8-
}
7+
"hidden": true,
8+
"public": false
9+
}

coder-apps/common/coder/app/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ exports.api_app_create_handler = function( app, req, res ) {
129129
author: coderlib.device.owner,
130130
name: apptitle,
131131
hidden: false,
132+
public: false
132133
};
133134
var metapath = process.cwd() + '/apps/' + newappid + '/meta.json';
134135
fs.writeFileSync( metapath, JSON.stringify(metainfo, null, 4), 'utf8' );

coder-apps/common/coder/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#bdc3c7",
55
"author": "Jason Striegel",
66
"name": "Coder",
7-
"hidden": true
8-
}
7+
"hidden": true,
8+
"public": false
9+
}

coder-apps/common/coderlib/app/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ exports.app = function(name, callback) {
8080
color: "#1abc9c",
8181
author: "Coder",
8282
name: name,
83-
hidden: false
83+
hidden: false,
84+
public: false
8485
},
8586

8687
load: function(callback) {

coder-apps/common/coderlib/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#3e3e3e",
55
"author": "Jason Striegel",
66
"name": "CoderLib",
7-
"hidden": true
8-
}
7+
"hidden": true,
8+
"public": false
9+
}

coder-apps/common/editor/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#80d4ea",
55
"author": "Jason Striegel",
66
"name": "Editor",
7-
"hidden": true
8-
}
7+
"hidden": true,
8+
"public": false
9+
}

coder-apps/common/eyeball/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#f39c12",
55
"author": "Justin Windle",
66
"name": "Eyeball",
7-
"hidden": false
8-
}
7+
"hidden": false,
8+
"public": false
9+
}

coder-apps/common/game2d/app/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#3e3e3e",
55
"author": "Justin Windle",
66
"name": "Game2D",
7-
"hidden": true
7+
"hidden": true,
8+
"public": false
89
}

coder-apps/common/hello_coder/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#d977d4",
55
"author": "Jason Striegel",
66
"name": "Hello Coder",
7-
"hidden": false
8-
}
7+
"hidden": false,
8+
"public": false
9+
}

coder-apps/common/space_rocks_/app/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"color": "#3498d8",
55
"author": "Justin Windle",
66
"name": "Space Rocks!",
7-
"hidden": false
8-
}
7+
"hidden": false,
8+
"public": false
9+
}

coder-base/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ var apphandler = function( req, res, appdir ) {
6161
userapp = app.require()
6262

6363
//Redirect to sign-in for unauthenticated users
64-
publicAllowed = ["auth"]; //apps that are exempt from any login (should only be auth)
6564
user = auth.isAuthenticated(req, res);
66-
if ( !user && publicAllowed.indexOf( appname ) < 0) {
65+
console.log(app.metadata)
66+
if ( !user && !app.metadata.public) {
6767
util.log( "redirect: " + '/app/auth' );
6868
res.redirect('/app/auth');
6969
return;

0 commit comments

Comments
 (0)