fix: social login state

This commit is contained in:
Lakhan Samani 2024-05-08 09:56:06 +05:30
parent 5add964449
commit 28390ebbe4
No known key found for this signature in database

View File

@ -7,7 +7,7 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/authorizerdev/authorizer/server/constants" "github.com/authorizerdev/authorizer/server/constants"
@ -40,11 +40,8 @@ func OAuthLoginHandler() gin.HandlerFunc {
} }
if state == "" { if state == "" {
log.Debug("state is empty") log.Debug("state is empty. creating a new state")
c.JSON(400, gin.H{ state = uuid.New().String()
"error": "invalid state",
})
return
} }
var scope []string var scope []string