Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ass/commit/04ef991fbcc9468bfe83f4953dbc8e37ae36ecc2
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
6 additions and
13 deletions
@ -30,6 +30,11 @@ const assMetaMiddleware = (port: number, proxied: boolean): RequestHandler =>
host : ` ${ req . protocol } :// ${ req . hostname } ${ proxied ? '' : ` : ${ port } ` } ` ,
version : App.pkgVersion
} ;
// Set up Session if required
if ( ! req . session . ass )
( log . debug ( 'Session missing' ) , req . session . ass = { } ) ;
next ( ) ;
} ;
@ -9,18 +9,6 @@ import { nanoid } from '../generators';
import { UserConfig } from '../UserConfig' ;
import { MySql } from '../sql/mysql' ;
/ * *
* Validates a user login session
* /
const validateSessions : RequestHandler = ( req , res , next ) = > {
if ( ! req . session . ass ) ( log . debug ( 'Session missing' ) , req . session . ass = { } ) ;
// todo: actually authenticate (data.get needs to be updated for subproperties maybe)
// data.get('')
next ( ) ;
} ;
const router = Router ( { caseSensitive : true } ) ;
// Setup route
@ -50,7 +38,7 @@ router.post('/setup', BodyParserJson(), async (req, res) => {
} ) ;
// User login
router . post ( '/login' , BodyParserJson ( ) , validateSessions , ( req , res ) = > {
router . post ( '/login' , BodyParserJson ( ) , ( req , res ) = > {
const { username , password } = req . body ;
data . getAll ( 'users' )