mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-10 08:25:42 +08:00
disable auth on download link for bots
This commit is contained in:
parent
e6b2a796f9
commit
4f48a4c797
1 changed files with 5 additions and 0 deletions
|
@ -4,12 +4,17 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/divyam234/teldrive/utils"
|
||||
"github.com/divyam234/teldrive/utils/auth"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-jose/go-jose/v3/jwt"
|
||||
)
|
||||
|
||||
func Authmiddleware(c *gin.Context) {
|
||||
|
||||
if c.FullPath() == "/api/files/:fileID/:fileName" && utils.GetConfig().MultiClient {
|
||||
c.Next()
|
||||
}
|
||||
cookie, err := c.Request.Cookie("user-session")
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue