Skip to content

Commit 28390eb

Browse files
committed
fix: social login state
1 parent 5add964 commit 28390eb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

server/handlers/oauth_login.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"golang.org/x/oauth2"
88

99
"github.com/gin-gonic/gin"
10-
10+
"github.com/google/uuid"
1111
log "github.com/sirupsen/logrus"
1212

1313
"github.com/authorizerdev/authorizer/server/constants"
@@ -40,11 +40,8 @@ func OAuthLoginHandler() gin.HandlerFunc {
4040
}
4141

4242
if state == "" {
43-
log.Debug("state is empty")
44-
c.JSON(400, gin.H{
45-
"error": "invalid state",
46-
})
47-
return
43+
log.Debug("state is empty. creating a new state")
44+
state = uuid.New().String()
4845
}
4946

5047
var scope []string

0 commit comments

Comments
 (0)