Skip to content

Commit fd9eb7c

Browse files
committed
fix: oauth state split
1 parent 917eaeb commit fd9eb7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/handlers/oauth_callback.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func OAuthCallbackHandler() gin.HandlerFunc {
3737
}
3838
sessionstore.GetState(state)
3939
// contains random token, redirect url, role
40-
sessionSplit := strings.Split(state, "@")
40+
sessionSplit := strings.Split(state, "___")
4141

4242
if len(sessionSplit) < 3 {
4343
c.JSON(400, gin.H{"error": "invalid redirect url"})

server/handlers/oauth_login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func OAuthLoginHandler() gin.HandlerFunc {
5858
roles = strings.Join(envstore.EnvStoreObj.GetSliceStoreEnvVariable(constants.EnvKeyDefaultRoles), ",")
5959
}
6060

61-
oauthStateString := state + "@" + redirectURI + "@" + roles + "@" + strings.Join(scope, ",")
61+
oauthStateString := state + "___" + redirectURI + "___" + roles + "___" + strings.Join(scope, ",")
6262

6363
provider := c.Param("oauth_provider")
6464
isProviderConfigured := true

0 commit comments

Comments
 (0)