1
0
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:
2018-02-19 16:06:33 -06:00
parent 79b4fecd3c
commit 02fe8e1748
16 changed files with 490 additions and 286 deletions

View File

@@ -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 {