Files
discord-retokenizer/endpoints/access.go
2022-12-09 23:26:38 -06:00

16 lines
322 B
Go

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)
}