Auth: Accept access token as passwd with fail rate limit #782 #808 #3943

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-14 18:28:17 +01:00
parent 9586a9ec69
commit fed1d8ad95
71 changed files with 930 additions and 507 deletions

View File

@@ -19,13 +19,13 @@ func UpdateClientConfig() {
// GET /api/v1/config
func GetClientConfig(router *gin.RouterGroup) {
router.GET("/config", func(c *gin.Context) {
s := Session(AuthToken(c))
sess := Session(ClientIP(c), AuthToken(c))
conf := get.Config()
if s == nil {
if sess == nil {
c.JSON(http.StatusOK, conf.ClientPublic())
} else {
c.JSON(http.StatusOK, conf.ClientSession(s))
c.JSON(http.StatusOK, conf.ClientSession(sess))
}
})
}