Skip to content

Commit 4697066

Browse files
author
Mathieu Grzybek
committed
[JWT] add a more complete regex
1 parent 15373e9 commit 4697066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/oidc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ func GetID(tokenString string) ID {
6767
}
6868

6969
func validateTokenstring(tokenString string) bool {
70-
matched, err := regexp.MatchString(`^\w{111}\.\S{1000}\S{423}$`, tokenString)
70+
matched, err := regexp.MatchString(`^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$`, tokenString)
7171
return ( err == nil && matched == true )
7272
}

0 commit comments

Comments
 (0)