From 0305ce03964f0959afe0e5337792e29a99d3fb9a Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Tue, 15 Jan 2019 19:07:48 +0100 Subject: [PATCH] Don't expect base64 padding on cookie values --- authdb/authdb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authdb/authdb.go b/authdb/authdb.go index a5eceac..9b629ac 100644 --- a/authdb/authdb.go +++ b/authdb/authdb.go @@ -91,7 +91,7 @@ func (c *UserContext) MarshalJSON() ([]byte, error) { // token creation time. To validate the authenticity of the token, use // ValidatePBKDF2(). func DecodeAuthToken(token string) (username string, created time.Time, err error) { - payload, err := base64.RawURLEncoding.DecodeString(token) + payload, err := base64.RawURLEncoding.WithPadding(base64.NoPadding).DecodeString(token) if err != nil { return username, created, err }