Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a2a4ec8 + ddf5aff commit dd10262Copy full SHA for dd10262
pkg/srv/mw/auth.go
@@ -7,6 +7,7 @@ package mw
7
8
import (
9
"context"
10
+ "crypto/subtle"
11
"net/http"
12
13
"gitlab.com/postgres-ai/database-lab/v2/pkg/services/platform"
@@ -45,7 +46,7 @@ func (a *Auth) isAccessAllowed(ctx context.Context, token string) bool {
45
46
return false
47
}
48
- if a.verificationToken == token {
49
+ if subtle.ConstantTimeCompare([]byte(a.verificationToken), []byte(token)) == 1 {
50
return true
51
52
0 commit comments