Fix root route parsing to exclude base
This commit is contained in:
parent
83b11e267e
commit
d1d12663a7
@ -21,6 +21,10 @@ class FrontendUnit extends Unit {
|
||||
app.express.use('/app', [
|
||||
this.canon.get('middleware::auth:UserOnly'),
|
||||
(req, res, next) => {
|
||||
if ( !req.user ) {
|
||||
return res.redirect('/auth/login')
|
||||
}
|
||||
|
||||
const allowed_extensions = [
|
||||
'.html', '.js', '.css', '.svg', '.ttf', '.jpg', '.png',
|
||||
'.jpeg', '.webmanifest', '.json', '.eot', '.svg', '.cur',
|
||||
|
@ -29,7 +29,8 @@ class Router {
|
||||
constructor() {
|
||||
try {
|
||||
const route = location.href.split(APP_BASE_PATH).filter(Boolean)[0].split(/[#?]/)[0]
|
||||
if ( route ) {
|
||||
if ( route && !route.toLowerCase().includes('http://') && !route.toLowerCase().includes('https://') ) {
|
||||
console.log('resume route', route)
|
||||
this.navigate(route, {})
|
||||
}
|
||||
} catch (e) {}
|
||||
|
Loading…
Reference in New Issue
Block a user