fix: handle signup token

This commit is contained in:
Lakhan Samani
2021-07-28 23:53:54 +05:30
parent 78b5b33a3d
commit d1973c1f8f
6 changed files with 32 additions and 31 deletions

View File

@@ -2,6 +2,7 @@ package handlers
import (
"github.com/99designs/gqlgen/graphql/handler"
"github.com/authorizerdev/authorizer/server/constants"
"github.com/authorizerdev/authorizer/server/graph"
"github.com/authorizerdev/authorizer/server/graph/generated"
"github.com/gin-gonic/gin"
@@ -14,6 +15,9 @@ func GraphqlHandler() gin.HandlerFunc {
h := handler.NewDefaultServer(generated.NewExecutableSchema(generated.Config{Resolvers: &graph.Resolver{}}))
return func(c *gin.Context) {
if constants.AUTHORIZER_DOMAIN == "" {
constants.AUTHORIZER_DOMAIN = "https://" + c.Request.Host
}
h.ServeHTTP(c.Writer, c.Request)
}
}