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:
10
server/webserver/handlers/config.go
Normal file
10
server/webserver/handlers/config.go
Normal 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})
|
||||
}
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user