Added config for Firebase key

This commit is contained in:
2024-08-23 21:45:10 +02:00
parent b451da7e8e
commit 365d5a68a1
5 changed files with 25 additions and 17 deletions

View File

@ -12,7 +12,7 @@ import (
func ServePDFList(c *b.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if tokenIsVerified(w, r) {
if tokenIsVerified(w, r, c) {
files, err := os.ReadDir(c.PDFDir)
if err != nil {
log.Println(err)
@ -37,7 +37,7 @@ func ServePDFList(c *b.Config) http.HandlerFunc {
func ServePDF(c *b.Config) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if tokenIsVerified(w, r) {
if tokenIsVerified(w, r, c) {
http.ServeFile(w, r, fmt.Sprint(c.PDFDir, "/", r.PathValue("id")))
}
}