mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-11 09:32:50 +00:00
use oauth for file uploads
This commit is contained in:
@@ -11,15 +11,12 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// FileUpload
|
||||
// FileUpload -
|
||||
func FileUpload(c *gin.Context) {
|
||||
|
||||
password := c.PostForm("password")
|
||||
|
||||
if string(password) != config.Config.UploadPassword {
|
||||
c.JSON(http.StatusInternalServerError, "Invalid password.")
|
||||
return
|
||||
}
|
||||
// originalClaims, _ := c.Get("claims")
|
||||
// claims, _ := originalClaims.(*middleware.CustomClaims)
|
||||
// TODO: verify user for upload
|
||||
|
||||
file, err := c.FormFile("file")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user