mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-10 09:02:49 +00:00
use oauth for file uploads
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/handlers"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/pubg"
|
||||
)
|
||||
|
||||
@@ -24,9 +25,12 @@ func getRouter() *gin.Engine {
|
||||
api.GET("/ytdownloader", handlers.Downloader)
|
||||
api.GET("/soundlist", handlers.SoundList)
|
||||
api.GET("/cliplist", handlers.ClipList)
|
||||
api.POST("/upload", handlers.FileUpload)
|
||||
api.POST("/oauth", handlers.Oauth)
|
||||
|
||||
authorizedAPI := router.Group("/api")
|
||||
authorizedAPI.Use(middleware.AuthorizedJWT())
|
||||
authorizedAPI.POST("/upload", handlers.FileUpload)
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user