1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-09 16:42:48 +00:00

fetch client id from server for oauth

This commit is contained in:
2018-04-15 16:16:24 -05:00
parent f13b177a93
commit 5d5717effe
5 changed files with 60 additions and 15 deletions

View File

@@ -0,0 +1,10 @@
package handlers
import (
"github.com/gin-gonic/gin"
"github.com/mgerb/go-discord-bot/server/config"
)
func GetClientID(c *gin.Context) {
c.JSON(200, map[string]string{"id": config.Config.ClientID})
}

View File

@@ -30,6 +30,7 @@ func getRouter() *gin.Engine {
api.POST("/oauth", handlers.Oauth)
api.GET("/logger/messages", handlers.GetMessages)
api.GET("/logger/linkedmessages", handlers.GetLinkedMessages)
api.GET("/config/client_id", handlers.GetClientID)
authorizedAPI := router.Group("/api")
authorizedAPI.Use(middleware.AuthorizedJWT())