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",
|
||||
target: "/static/whitney-400.woff",
|
||||
},
|
||||
{
|
||||
type: "js",
|
||||
source: "/js/main.js",
|
||||
target: "/static/main.js",
|
||||
},
|
||||
{
|
||||
type: "js",
|
||||
source: "/js/basic.js",
|
||||
|
@ -127,6 +132,6 @@ module.exports = [
|
|||
{
|
||||
type: "pug",
|
||||
source: "/login.pug",
|
||||
target: "/login.html",
|
||||
target: "/login/index.html",
|
||||
},
|
||||
];
|
||||
|
|
10
src/home.pug
10
src/home.pug
|
@ -33,18 +33,14 @@ doctype html
|
|||
html
|
||||
head
|
||||
meta(charset="utf-8")
|
||||
title Carbon
|
||||
// var static = !{JSON.stringify([...static.entries()].reduce((a, c) => (a[c[0]] = getRelative(c[1]), a), {}))}
|
||||
script
|
||||
| var staticFiles = new Map(
|
||||
!= JSON.stringify([...static.keys()].map(k => [k, getStatic(k)]))
|
||||
| )
|
||||
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/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
|
||||
script(type="module" src=getStatic("/js/main.js"))
|
||||
body
|
||||
main.main
|
||||
.c-groups
|
||||
|
@ -56,4 +52,4 @@ html
|
|||
.c-chat__messages#c-chat-messages
|
||||
.c-chat__inner#c-chat
|
||||
.c-chat-input
|
||||
textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea
|
||||
textarea(placeholder="Send a message..." autocomplete="off").c-chat-input__textarea#c-chat-textarea
|
||||
|
|
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