Add Websocket authentication #216

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-01-22 16:54:01 +01:00
parent f569c3adb6
commit 7342d5194a
8 changed files with 194 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/event"
"github.com/photoprism/photoprism/internal/form"
"github.com/photoprism/photoprism/internal/session"
"github.com/photoprism/photoprism/pkg/txt"
@@ -33,6 +34,8 @@ func CreateSession(router *gin.RouterGroup, conf *config.Config) {
s := gin.H{"token": token, "user": user}
event.Publish("config.updated", event.Data(conf.ClientConfig()))
c.JSON(http.StatusOK, s)
})
}