Skip to content

Commit 1c3be75

Browse files
committed
Don't expect base64 padding on cookie values
1 parent 225e9fc commit 1c3be75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

authdb/authdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (c *UserContext) MarshalJSON() ([]byte, error) {
9191
// token creation time. To validate the authenticity of the token, use
9292
// ValidatePBKDF2().
9393
func DecodeAuthToken(token string) (username string, created time.Time, err error) {
94-
payload, err := base64.RawURLEncoding.DecodeString(token)
94+
payload, err := base64.RawURLEncoding.WithPadding(base64.NoPadding).DecodeString(token)
9595
if err != nil {
9696
return username, created, err
9797
}

0 commit comments

Comments
 (0)