From 28390ebbe4508d8c425fe256fb19e29076a699f7 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Wed, 8 May 2024 09:56:06 +0530 Subject: [PATCH] fix: social login state --- server/handlers/oauth_login.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/handlers/oauth_login.go b/server/handlers/oauth_login.go index 64023400c..b41485f0a 100644 --- a/server/handlers/oauth_login.go +++ b/server/handlers/oauth_login.go @@ -7,7 +7,7 @@ import ( "golang.org/x/oauth2" "github.com/gin-gonic/gin" - + "github.com/google/uuid" log "github.com/sirupsen/logrus" "github.com/authorizerdev/authorizer/server/constants" @@ -40,11 +40,8 @@ func OAuthLoginHandler() gin.HandlerFunc { } if state == "" { - log.Debug("state is empty") - c.JSON(400, gin.H{ - "error": "invalid state", - }) - return + log.Debug("state is empty. creating a new state") + state = uuid.New().String() } var scope []string