Store auth info in a JWT token in a cookie
This commit is contained in:
parent
3e0a1be6bc
commit
fb54d4966c
18 changed files with 499 additions and 331 deletions
|
@ -29,10 +29,16 @@ type File struct {
|
|||
|
||||
func serveFiles(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/" {
|
||||
handleAuth(w, r)
|
||||
serveFile(w, r, "index.html.gz", "text/html")
|
||||
return
|
||||
}
|
||||
|
||||
if strings.HasSuffix(r.URL.Path, "favicon.ico") {
|
||||
w.WriteHeader(404)
|
||||
return
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
if strings.HasSuffix(r.URL.Path, file.Path) {
|
||||
serveFile(w, r, file.Path+".gz", file.ContentType)
|
||||
|
@ -40,6 +46,7 @@ func serveFiles(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
handleAuth(w, r)
|
||||
serveFile(w, r, "index.html.gz", "text/html")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue