Fix login issues regarding basicauth+noauth #214 #204

This commit is contained in:
Henrique Dias committed 2017-08-22 15:25:54 +01:00
1 parent 1aa68b0dd0
commit c95b1aaace
9 files changed
+318 -315

No files matched your search

-2
View File
@@ -59,7 +59,6 @@ func renewAuthHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (in
// claims is the JWT claims.
type claims struct {
fm.User
NoAuth bool `json:"noAuth"`
jwt.StandardClaims
}
@@ -74,7 +73,6 @@ func printToken(c *fm.Context, w http.ResponseWriter) (int, error) {
// Builds the claims.
claims := claims{
u,
c.NoAuth,
jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Hour * 24).Unix(),
Issuer: "File Manager",
+4 -1
View File
@@ -223,7 +223,10 @@ func renderFile(c *fm.Context, w http.ResponseWriter, file string, contentType s
tpl := template.Must(template.New("file").Parse(file))
w.Header().Set("Content-Type", contentType+"; charset=utf-8")
data := map[string]interface{}{"BaseURL": c.RootURL()}
data := map[string]interface{}{
"BaseURL": c.RootURL(),
"NoAuth": c.NoAuth,
}
if c.StaticGen != nil {
data["StaticGen"] = c.StaticGen.Name()