Skip to content

Commit

Permalink
fix: social login state
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhansamani committed May 8, 2024
1 parent 5add964 commit 28390eb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions server/handlers/oauth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 28390eb

Please sign in to comment.