I made this same mistake. The default password was 50 long so I used powershell to generate a 50 long random string and replaced the old SECRET_KEY with it. I was logged in and after replacing the SECRET_KEY my previous session had been invalidated.
With Powershell (source):
# Load the .net System.Web namespace which has the GeneratePassword function
[Reflection.Assembly]::LoadWithPartialName("System.Web")
# GeneratePassword(int length, int numberOfNonAlphanumericCharacters)
[System.Web.Security.Membership]::GeneratePassword(50,5)
With Bash (source):
# tr includes ABCabc123 and the characters from OWASP's "Password special characters list"
cat /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 100 ; echo
At this point I thought why not try a larger key, so I tried it with a 100 and 1000 long key. Both worked. If I understand the source code, the object returned by the signer function is a hmac hash in base64. RFC 2104 has this to say for the required length of a HMAC secret key.
Applications that use keys longer
than B bytes will first hash the key using H and then use the
resultant L byte string as the actual key to HMAC.
The key for HMAC can be of any length (keys longer than B bytes are
first hashed using H). However, less than L bytes is strongly
discouraged as it would decrease the security strength of the
function. Keys longer than L bytes are acceptable but the extra
length would not significantly increase the function strength. (A
longer key may be advisable if the randomness of the key is
considered weak.)
To translate into normal speak, the size of the secret key needs to be the same size as the output. The key also needs to be in bits. Each digit in base64 represents 6 bits. So if you had a 50 character password, you would have a 50 x 6 = 300 bit secret key. If you are using SHA256, then you would need a 256 bit key (sha256 uses 256 bits by definition). So a 50 long password should work unless you plan to use a hashing algorithm larger than SHA256.
But since any extra bits in the key are being hashed, the size of it wont drastically decrease performance. But it would guarantee you that you have a enough bits for larger hash functions. SHA-512 would be covered by a 100 long SECRET_KEY (50 x 6 = 600 bits > 512 bits).