This commit is contained in:
2022-12-09 23:26:38 -06:00
parent 8df6231b71
commit d8a6c8acd1
15 changed files with 643 additions and 56 deletions

16
endpoints/access.go Normal file
View File

@@ -0,0 +1,16 @@
package endpoints
import (
"git.zomo.dev/zomo/discord-retokenizer/storage"
"github.com/gin-gonic/gin"
)
func access(c *gin.Context) {
authType, token := getAuthorization(c)
if authType != AuthorizationScopeBot {
c.AbortWithStatus(401)
}
_, botToken := storage.BotTokenFromToken(token)
c.String(200, botToken)
}