Redirect to login page if not logged in
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
988dd1050b
commit
184c876fb9
3 changed files with 18 additions and 8 deletions
7
spec.js
7
spec.js
|
@ -9,6 +9,11 @@ module.exports = [
|
||||||
source: "/assets/fonts/whitney-400.woff",
|
source: "/assets/fonts/whitney-400.woff",
|
||||||
target: "/static/whitney-400.woff",
|
target: "/static/whitney-400.woff",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: "js",
|
||||||
|
source: "/js/main.js",
|
||||||
|
target: "/static/main.js",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: "js",
|
type: "js",
|
||||||
source: "/js/basic.js",
|
source: "/js/basic.js",
|
||||||
|
@ -127,6 +132,6 @@ module.exports = [
|
||||||
{
|
{
|
||||||
type: "pug",
|
type: "pug",
|
||||||
source: "/login.pug",
|
source: "/login.pug",
|
||||||
target: "/login.html",
|
target: "/login/index.html",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -33,18 +33,14 @@ doctype html
|
||||||
html
|
html
|
||||||
head
|
head
|
||||||
meta(charset="utf-8")
|
meta(charset="utf-8")
|
||||||
|
title Carbon
|
||||||
// var static = !{JSON.stringify([...static.entries()].reduce((a, c) => (a[c[0]] = getRelative(c[1]), a), {}))}
|
// var static = !{JSON.stringify([...static.entries()].reduce((a, c) => (a[c[0]] = getRelative(c[1]), a), {}))}
|
||||||
script
|
script
|
||||||
| var staticFiles = new Map(
|
| var staticFiles = new Map(
|
||||||
!= JSON.stringify([...static.keys()].map(k => [k, getStatic(k)]))
|
!= JSON.stringify([...static.keys()].map(k => [k, getStatic(k)]))
|
||||||
| )
|
| )
|
||||||
link(rel="stylesheet" type="text/css" href=getStatic("/sass/main.sass"))
|
link(rel="stylesheet" type="text/css" href=getStatic("/sass/main.sass"))
|
||||||
script(type="module" src=getStatic("/js/groups.js"))
|
script(type="module" src=getStatic("/js/main.js"))
|
||||||
script(type="module" src=getStatic("/js/chat-input.js"))
|
|
||||||
script(type="module" src=getStatic("/js/room-picker.js"))
|
|
||||||
script(type="module" src=getStatic("/js/sync/sync.js"))
|
|
||||||
script(type="module" src=getStatic("/js/chat.js"))
|
|
||||||
title Carbon
|
|
||||||
body
|
body
|
||||||
main.main
|
main.main
|
||||||
.c-groups
|
.c-groups
|
||||||
|
|
9
src/js/main.js
Normal file
9
src/js/main.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import $to_relative "/js/groups.js"
|
||||||
|
import $to_relative "/js/chat-input.js"
|
||||||
|
import $to_relative "/js/room-picker.js"
|
||||||
|
import $to_relative "/js/sync/sync.js"
|
||||||
|
import $to_relative "/js/chat.js"
|
||||||
|
|
||||||
|
if (!localStorage.getItem("access_token")) {
|
||||||
|
location.assign("./login")
|
||||||
|
}
|
Loading…
Reference in a new issue