@@ -16,6 +16,7 @@ var command = require('commander');
16
16
17
17
command . option ( '-d, --database [database]' , 'Database configuration file.' )
18
18
. option ( '-u, --username [username]' , 'Database username file' )
19
+ . option ( '-n, --no-auth' , 'disables authentication' )
19
20
. option ( '-p, --password [password]' , 'Database password file' ) . parse ( process . argv ) ;
20
21
21
22
var timescale_config = null ;
@@ -99,7 +100,7 @@ console.log("Using timescale at " + timescale_config.host +
99
100
100
101
// Do a query of the deployments table so that we can load a map
101
102
app . get ( '/init' , ( req , resp , next ) => {
102
- if ( ! req . isAuthenticated ( ) ) {
103
+ if ( ! req . isAuthenticated ( ) && command . auth ) {
103
104
resp . redirect ( '/login' ) ;
104
105
return ;
105
106
}
@@ -154,7 +155,7 @@ app.get('/init', (req, resp, next) => {
154
155
} ) ;
155
156
156
157
app . get ( '/getData' , ( req , resp ) => {
157
- if ( ! req . isAuthenticated ( ) ) {
158
+ if ( ! req . isAuthenticated ( ) && command . auth ) {
158
159
resp . redirect ( '/login' ) ;
159
160
return ;
160
161
}
@@ -295,7 +296,7 @@ app.get('/login/google/return',
295
296
296
297
297
298
app . get ( '/' , function ( req , res ) {
298
- if ( ! req . isAuthenticated ( ) ) {
299
+ if ( ! req . isAuthenticated ( ) && command . auth ) {
299
300
res . redirect ( '/login' ) ;
300
301
return ;
301
302
}
0 commit comments