more
This commit is contained in:
16
endpoints/access.go
Normal file
16
endpoints/access.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user