mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Refactor download urls and client config
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
@@ -61,3 +61,19 @@ func Unauthorized(c *gin.Context, conf *config.Config) bool {
|
||||
// Check if session token is valid
|
||||
return !service.Session().Exists(token)
|
||||
}
|
||||
|
||||
// InvalidToken returns true if the token is invalid.
|
||||
func InvalidToken(c *gin.Context, conf *config.Config) bool {
|
||||
token := c.Param("token")
|
||||
|
||||
if token == "" {
|
||||
token = c.Query("t")
|
||||
}
|
||||
|
||||
return conf.InvalidToken(token)
|
||||
}
|
||||
|
||||
// InvalidDownloadToken returns true if the token is invalid.
|
||||
func InvalidDownloadToken(c *gin.Context, conf *config.Config) bool {
|
||||
return conf.InvalidDownloadToken(c.Query("t"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user